473,721 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

visual c++ 8 (.net 2005) has unresolved external symbol errors

The error is LNK2001: unresolved external symbol "protected: static
bool solver<typename , typename, int, int, int, int,
int>::solution" (<vc++ mangled name>)
Code (sudoku.cpp):
// Sudoku.cpp : Defines the entry point for the console application.
//
#include <iostream>
#include <vector>
#include <stdexcept>
#include <cstdlib>
#include <cmath>
#include <cstring>

#ifdef _MSC_VER
#define inline __inline
#endif

typedef unsigned __int8 u8;
typedef signed __int8 s8;
typedef unsigned __int16 u16;
typedef signed __int16 s16;
typedef unsigned __int32 u32;
typedef signed __int32 s32;
typedef signed __int64 u64;
typedef signed __int64 s64;

#define nullptr(T) (T *)0

#define check_calloc(pt r, ptrname, type, n, if_fail, if_fail_msg) \
if (ptr == nullptr(type)) {\
cerr << "calloc could not allocate " << ptrname << " [n=" << n <<
"], " << if_fail_msg; \
if_fail; \
}

//safety check: at least 1 _N must be defined
#if (!(defined _4) && !(defined _9) && !(defined _16) \
&& !(defined _25) && !(defined _36) && !(defined _49) && !(defined
_64))
#error "No _N(s) declared!!!"
#endif

using namespace std;

template <typename T, int nstruct sumOfBits {
static const T value = (T)((1 << (n - 1)) + sumOfBits<T, n -
1>::value);
};
template<typena me Tstruct sumOfBits<T, 0{
static const T value = (T)0;
};

template <typename T>
class array {
public:
size_t length;
array(size_t _length) {
data = new T[_length];
length = _length;
}
T& operator[](unsigned int n) {
if ((size_t)n >= length) {
clog << "Array index out of range (n=" << n << ", length=" <<
length << "\"\n";
throw out_of_range("A rray index out of range");
}
return data[n];
}
T& elem(unsigned int n) {
return data[n];
}
~array() { delete[] data; }
private:
T* data;
};

//templates: flexible hardcoding :P
template <typename cell_t = u16, typename pos_t = u8,
unsigned int width = 9, unsigned int width_rt = 3, int width_sq = 81,
cell_t val_mask = sumOfBits<u16, 9>::value,
unsigned int zb_len = 11>
class solver {
public:
solver() {
cells = (cell_t *)calloc(width_ sq, sizeof(cell_t)) ;
zeroBit = (char *)calloc(zb_len , 1);
}
//garbage collection
~solver() {
free(cells);
cells = (cell_t *)0;
free(zeroBit);
zeroBit = (char *)0;
}
static u8 *solve(u8 *board) {
solver *s = encode(board);
solver *s_copy = s;
u8 *sol = nullptr(u8);
solution = false;
s = s->search();
if (solution) {
sol = s->decode();
delete s;
} else
delete s_copy;
return sol;
}
protected:
//data
cell_t *cells;
//0th bit
char *zeroBit;
//is the puzzle solved
static bool solution;
//copy current solver
solver *duplicate(void ) {
solver *dest = new solver();
pos_t i;
for (i = 0; i < width_sq; i++) {
dest->cells[i] = cells[i];
dest->zeroBit[i] = zeroBit[i];
}
return dest;
}
//check zeroBit
inline bool checkBit(pos_t i, char bit) {
u8 _byte = (u8)floor((i + 1) / 8.0);
return ((zeroBit[_byte] & (1 << (i % 8))) == bit) ? true : false;
}
//find most constrained position
pos_t constrained(voi d) {
u8 max = sumOfBits<u8, 7>::value;
pos_t maxp = (pos_t)max, i;
u8 j, v;

for (i = 0; i < width_sq; ++i) {
if (checkBit(i, 0)) {
v = 0;
for (j = 0; j < width; ++j)
if (((1 << j) & cells[i]) != 0)
++v;
if (v >= max || max >= sumOfBits<u8, 7>::value) {
max = v;
maxp = i;
}
}
}
return maxp;
}
//get all available options for value val
array<u8*option s(cell_t val) {
vector<u8cc(0);
array<u8*arr;
u8 i;
//find and add avialbale numbers
for (i = 0; i < width; ++i)
if (((1 << i) & val) == 0)
cc.push_back(i + 1);
arr = new array<u8>(cc.si ze());
for (i = 0; i < arr->length; i++)
arr->elem(i) = cc[i];
return arr;
}
//set value val in position pos, NOT-masking the other positions in
the group
void set(pos_t pos, u8 val) {
//column
u8 x = pos % width;
//row
u8 y = (u8)floor((pos * 1.0) / width);
//zone column, row
u8 zx = (u8)floor((x * 1.0) / width_rt) * width_rt;
u8 zy = (u8)floor((y * 1.0) / width_rt) * width_rt;
//value bit
cell_t add = 1 << ((cell_t)val - 1);
u8 k;
//NOT-mask the other positions in the group
for (k = 0; k < width; ++k) {
//mask column
cells[x + k * width] |= add;
//mask row
cells[k + y * width] |= add;
//mask zone
cells[zx + (k % width_rt) + width * (zy + (u8)floor((k * 1.0) /
width_rt))] |= add;
}
//unmask pos
cells[pos] = val_mask - add;
}
//sanity check
inline bool okay(void) {
pos_t i;
for (i = 0; i < width_sq; ++i)
if (((cells[i] & val_mask) == val_mask) && checkBit(i, 0))
return false;
return true;
}
//check if solved
inline bool solved(void) {
pos_t i;
for (i = 0; i < width_sq; ++i) {
if (checkBit(i, 0))
return false;
}
return true;
}
//search for solutions, return pointer to solution or null pointer
solver *search(void) {
pos_t p;
array<u8*l;
u8 i;
solver *ns;
solver *ns_backup; //avoid memory leaks by backing up pointer
while (okay()) {
if (solved()) {
solution = true;
return this;
}
//start solving from most constrained position
p = constrained();
//no solution
if (p < 0)
return nullptr(solver) ;
//get all the available options for cell p
l = options(cells[p]);
//no solution
if (l->length < 1)
return nullptr(solver) ;
//try each option in cell p by recursing ourselves
//(i.e., (...(ns = this) ... = this))
for (i = 0; i < l->length; ++i) {
//recurse
ns = duplicate();
ns->set(p, l->elem(i));
ns_backup = ns; //avoid memory leaks
ns = ns->search();
//solution found, recurse back up
if (ns != nullptr(solver) )
return ns;
else //solution not found, deallocate ns using backup
delete ns_backup;
}
//try first option
set(p, l->elem(0));
}
//failed sanity check
return nullptr(solver) ;
}
//decode bitmask solution to numerical solution
u8 *decode(void) {
u8 *arr = (u8 *)calloc(width_ sq, sizeof(u8));
if (arr == nullptr(u8))
return arr;
pos_t i;
u8 j;
for (i = 0; i < width_sq; ++i)
for (j = 0; j < width; ++j)
if (((cells[i] | (cell_t)(1 << j)) == val_mask) && checkBit(i, 1))
{
arr[i] = j + (width < 10 ? 1 : 0);
break;
}
return arr;
}
static solver *encode(u8 *arr) {
solver *a = new solver();
pos_t i;
for (i = 0; i < width_sq; ++i) {
/* MAKE SURE that the number is between 1 and 9, inclusive so that
the
* solver does NOT mask 0 because that would break function isOK()
and
* hence prevent the solver from reaching a solution.
*/
if (width < 10) {
if (arr[i] >= 1 && arr[i] <= width)
a->set(i, arr[i]);
} else {
if (arr[i] >= 0 && arr[i] < width)
a->set(i + 1, arr[i]);
}
}
return a;
}
solver<cell_t, pos_t, width, width_rt, width_sq, val_mask, zb_len>::
};
//pase sIng to array
u8 *parse (char *str, unsigned __int8 base) {
u8 i;
u16 b2;
b2 = base * base;
u8 *arr = (u8 *)calloc(b2, 1);
if (arr == nullptr(u8))
return nullptr(u8);
for (i = 0; i < b2; i++) {
if (str[i] >= 0x30 && str[i] <= 0x39) //'0'-'9'
arr[i] = str[i] - 0x30;
else if (base >= 11) { //'a'-'z'
if (str[i] >= 0x61 && str[i] <= 0x7a)
arr[i] = str[i] - 0x57;
}
else if (base >= 37) { //'A'-'Z'
if (str[i] >= 0x41 && str[i] <= 0x5a)
arr[i] = str[i] - 0x1d;
}
else if (base >= 62) { //','-'.'
if (str[i] == 0x2c || str[i] == 0x2e)
arr[i] = (str[i] == 0x2c ? 62 : 63);
}
else
arr[i] = 1 << 7;
}
return arr;
}
//create sIng from array
char *arr_str(const u8 *arr, u16 len) {
char *str = (char *)calloc(len, 1);
u16 i;
if (str == nullptr(char))
return nullptr(char);
for (i = 0; i < len; i++) {
if (arr[i] < 10) str[i] = arr[i] + 0x30; //0-9
else if (arr[i] < 37) str[i] = arr[i] + 0x57; //a-z
else if (arr[i] < 62) str[i] = arr[i] + 0x1d; //A-Z
else if (arr[i] == 62) str[i] = 0x2c; //,
else if (arr[i] == 63) str[i] = 0x2e; //.
else str[i] = 0x3f; //?
}
return str;
}

int main(int argc, char *argv[]) {
u8 doku;
u8 *arr;
u8 *sol;
char *sIn = nullptr(char);
if (argc == 3)
doku = (strncmp(argv[1], "16", 3) == 0) ? 16
: (strncmp(argv[1], "25", 3) == 0) ? 25
: (strncmp(argv[1], "36", 3) == 0) ? 36
: (strncmp(argv[1], "4", 2) == 0) ? 4
: (strncmp(argv[1], "49", 3) == 0) ? 49
: (strncmp(argv[1], "64", 3) == 0) ? 64
: (strncmp(argv[1], "9", 2) == 0) ? 9
: 0;
else
doku = 9; //sudoku (9)
switch (argc) {
case 2: //puzzle from argv[1]
#if ((defined _4) && !(defined _9) && !(defined _16) \
&& !(defined _25) && !(defined _36) && !(defined _49) && !(defined
_64))
arr = parse(argv[1], 16);
check_calloc(ar r, "arr", u8, 16, goto error, "exiting...\n") ;
goto doku4;
#endif //(_4)
#ifdef _9
arr = parse(argv[1], 81);
check_calloc(ar r, "arr", u8, 81, goto error, "exiting...\n") ;
goto doku9;
#endif //_9
#if (!(defined _4) && !(defined _9) && (defined _16) \
&& !(defined _25) && !(defined _36) && !(defined _49) && !(defined
_64))
arr = parse(argv[1], 256);
check_calloc(ar r, "arr", u8, 256, goto error, "exiting...\n") ;
goto doku16;
#endif //(_16)
#if (!(defined _4) && !(defined _9) && !(defined _16) \
&& (defined _25) && !(defined _36) && !(defined _49) && !(defined
_64))
arr = parse(argv[1], 625);
check_calloc(ar r, "arr", u8, 625, goto error, "exiting...\n") ;
goto doku25;
#endif //(_25)
#if (!(defined _4) && !(defined _9) && !(defined _16) \
&& !(defined _25) && (defined _36) && !(defined _49) && !(defined
_64))
arr = parse(argv[1], 1296);
check_calloc(ar r, "arr", u8, 1296, goto error, "exiting...\n") ;
goto doku36;
#endif //(_36)
#if (!(defined _4) && !(defined _9) && !(defined _16) \
&& !(defined _25) && !(defined _36) && (defined _49) && !(defined
_64))
arr = parse(argv[1], 2401);
check_calloc(ar r, "arr", u8, 2401, goto error, "exiting...\n") ;
goto doku49;
#endif //(_49)
#if (!(defined _4) && !(defined _9) && !(defined _16) \
&& !(defined _25) && !(defined _36) && !(defined _49) && (defined
_64))
arr = parse(argv[1], 4096);
check_calloc(ar r, "arr", u8, 4096, goto error, "exiting...\n") ;
goto doku64;
#endif //(_64)
case 3: //puzzle from argv[2]
switch (doku) {
#ifdef _4
case 4:
arr = parse(argv[2], 16);
check_calloc(ar r, "arr", u8, 16, goto error, "exiting...\n") ;
goto doku4;
#endif //_4
#ifdef _9
case 9:
arr = parse(argv[2], 81);
check_calloc(ar r, "arr", u8, 81, goto error, "exiting...\n") ;
goto doku9;
#endif //_9
#ifdef _16
case 16:
arr = parse(argv[2], 256);
check_calloc(ar r, "arr", u8, 256, goto error, "exiting...\n") ;
goto doku16;
#endif //_16
#ifdef _25
case 25:
arr = parse(argv[2], 625);
check_calloc(ar r, "arr", u8, 625, goto error, "exiting...\n") ;
goto doku25;
#endif //_25
#ifdef _36
case 36:
arr = parse(argv[2], 1296);
check_calloc(ar r, "arr", u8, 1296, goto error, "exiting...\n") ;
goto doku36;
#endif //_36
#ifdef _49
case 49:
arr = parse(argv[2], 2401);
check_calloc(ar r, "arr", u8, 2401, goto error, "exiting...\n") ;
goto doku49;
#endif //_49
#ifdef _64
case 64:
arr = parse(argv[2], 4096);
check_calloc(ar r, "arr", u8, 4096, goto error, "exiting...\n") ;
goto doku64;
#endif //_64
} //case 3 switch (doku)
case 1: //puzzle from stdin
switch (doku) {
#ifdef _4
case 4:
sIn = (char *)calloc(17, 1);
check_calloc(sI n, "sIn", char, 17, goto error, "exiting...\n") ;
cin >sIn;
arr = parse(sIn, 16);
check_calloc(ar r, "arr", u8, 16, goto error, "exiting...\n") ;
goto doku4;
#endif //_4
#ifdef _9
case 9:
sIn = (char *)calloc(82, 1);
check_calloc(sI n, "sIn", char, 82, goto error, "exiting...\n") ;
cin >sIn;
arr = parse(sIn, 81);
check_calloc(ar r, "arr", u8, 81, goto error, "exiting...\n") ;
goto doku9;
#endif //_9
#ifdef _16
case 16:
sIn = (char *)calloc(257, 1);
check_calloc(sI n, "sIn", char, 257, goto error, "exiting...\n") ;
cin >sIn;
arr = parse(sIn, 256);
check_calloc(ar r, "arr", u8, 256, goto error, "exiting...\n") ;
goto doku16;
#endif //_16
#ifdef _25
case 25:
sIn = (char *)calloc(626, 1);
check_calloc(sI n, "sIn", char, 626, goto error, "exiting...\n") ;
cin >sIn;
arr = parse(sIn, 625);
check_calloc(ar r, "arr", u8, 625, goto error, "exiting...\n") ;
goto doku25;
#endif //_25
#ifdef _36
case 36:
sIn = (char *)calloc(1297, 1);
check_calloc(sI n, "sIn", char, 1297, goto error, "exiting...\n") ;
cin >sIn;
arr = parse(sIn, 1296);
check_calloc(ar r, "arr", u8, 1296, goto error, "exiting...\n") ;
goto doku36;
#endif //_36
#ifdef _49
case 49:
sIn = (char *)calloc(2402, 1);
check_calloc(sI n, "sIn", char, 2402, goto error, "exiting...\n") ;
cin >sIn;
arr = parse(sIn, 2401);
check_calloc(ar r, "arr", u8, 2401, goto error, "exiting...\n") ;
goto doku49;
#endif //_49
#ifdef _64
case 64:
sIn = (char *)calloc(4097, 1);
check_calloc(sI n, "sIn", char, 4097, goto error, "exiting...\n") ;
cin >sIn;
arr = parse(sIn, 4096);
check_calloc(ar r, "arr", u8, 4096, goto error, "exiting...\n") ;
goto doku64;
#endif //_64
} //case 1 switch (doku)
} //switch(argc)

#ifdef _4
doku4:
sol = solver<u8, u8, 4, 2, 8, sumOfBits<u8, 4>::value,
1>::solve(arr) ;
if (sol == nullptr(u8))
goto no_solution_fou nd;
else
goto solution_found;
#endif //_4
#ifdef _9
doku9:
sol = solver<u16, u8, 9, 3, 81, sumOfBits<u16, 9>::value,
11>::solve(arr) ;
if (sol == nullptr(u8))
goto no_solution_fou nd;
else
goto solution_found;
#endif //_9
#ifdef _16
doku16:
sol = solver<u16, u8, 16, 4, 256, sumOfBits<u16, 16>::value,
32>::solve(arr) ;
if (sol == nullptr(u8))
goto no_solution_fou nd;
else
goto solution_found;
#endif //_16
#ifdef _25
doku25:
sol = solver<u32, u16, 25, 5, 625, sumOfBits<u32, 25>::value,
79>::solve(arr) ;
if (sol == nullptr(u8))
goto no_solution_fou nd;
else
goto solution_found;
#endif //_25
#ifdef _36
doku36:
sol = solver<u64, u16, 36, 6, 1296, sumOfBits<u64, 36>::value,
162>::solve(arr );
if (sol == nullptr(u8))
goto no_solution_fou nd;
else
goto solution_found;
#endif //_36
#ifdef _49
doku49:
sol = solver<u64, u16, 49, 7, 2401, sumOfBits<u64, 49>::value,
301>::solve(arr );
if (sol == nullptr(u8))
goto no_solution_fou nd;
else
goto solution_found;
#endif //_49
#ifdef _64
doku64:
sol = solver<u64, u16, 64, 8, 4096, sumOfBits<u64, 64>::value,
512>::solve(arr );
if (sol == nullptr(u8))
goto no_solution_fou nd;
else
goto solution_found;
#endif //_64
no_solution_fou nd:
cout << "No solution found for puzzle " << (argc == 3 ? argv[2] :
(sIn != nullptr(char)) ? sIn : argv[1]) << endl;
goto done;
solution_found:
cout << "Solution for puzzle " << (argc == 3 ? argv[2] : (sIn !=
nullptr(char)) ? sIn : argv[1])
<< " is " << arr_str(sol, (u16)strlen((sI n != nullptr(char)) ? sIn :
argv[1])) << endl;
goto done;
error:
return 1;
done:
return 0;
}

Compile with options -D_4 -D_9 -D_16 -D_25 -D_36 -D_49 -D_64
Any (elegant?) way to fix the error (if you can use diif -Naur fromat,
that would be very nice)?

Sep 26 '07 #1
6 2115
On 2007-09-26 03:39, an********@gmai l.com wrote:
The error is LNK2001: unresolved external symbol "protected: static
bool solver<typename , typename, int, int, int, int,
int>::solution" (<vc++ mangled name>)
Do not know if it matters but the solver class takes unsigned ints as
template parameters, not ints. Sorry, cannot help you more than that,
too much macro magic for me.

--
Erik Wikström
Sep 26 '07 #2
On 2007-09-26 03:39, an********@gmai l.com wrote:
The error is LNK2001: unresolved external symbol "protected: static
bool solver<cell_t, pos_t, width, width_sq, width_rt, val_mask,
zb_len>::soluti on" (<vc++ mangled name>)
The problem is that VC++ externs the variable, as seen from this line
of asm output:
EXTRN ?solution@?$sol ver@_KG$0EA@$07 $0BAAA@$0?0$0CA A@@@1_NA:BYTE ;
solver<cell_t, pos_t, width, width_sq, width_rt, val_mask,
zb_len>::soluti on

Any way to declare the variable or rework the class to fix this issue
(see first post for original code)?

Sep 26 '07 #3
On 2007-09-26 13:13:24 -0400, an********@gmai l.com said:
>
>On 2007-09-26 03:39, an********@gmai l.com wrote:
>>The error is LNK2001: unresolved external symbol "protected: static
bool solver<cell_t, pos_t, width, width_sq, width_rt, val_mask,
zb_len>::solu tion" (<vc++ mangled name>)

The problem is that VC++ externs the variable, as seen from this line
of asm output:
EXTRN ?solution@?$sol ver@_KG$0EA@$07 $0BAAA@$0?0$0CA A@@@1_NA:BYTE ;
solver<cell_t, pos_t, width, width_sq, width_rt, val_mask,
zb_len>::soluti on

Any way to declare the variable or rework the class to fix this issue
(see first post for original code)?
No, thanks. That was way too much code for such a simple problem. Do
the work to eliminate things that don't contribute to the error. Then
add a definition for the missing object.

--
Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The
Standard C++ Library Extensions: a Tutorial and Reference
(www.petebecker.com/tr1book)

Sep 26 '07 #4
On 2007-09-26 03:39, an********@gmai l.com wrote:
static solver *encode(u8 *arr) {
solver *a = new solver();
pos_t i;
for (i = 0; i < width_sq; ++i) {
/* MAKE SURE that the number is between 1 and 9, inclusive so that
the
* solver does NOT mask 0 because that would break function isOK()
and
* hence prevent the solver from reaching a solution.
*/
if (width < 10) {
if (arr[i] >= 1 && arr[i] <= width)
a->set(i, arr[i]);
} else {
if (arr[i] >= 0 && arr[i] < width)
a->set(i + 1, arr[i]);
}
}
return a;
}
solver<cell_t, pos_t, width, width_rt, width_sq, val_mask, zb_len>::
};
I took a new look at the code, and the line above is where my compiler
gave up, which is no surprise to me. When posting code that gives you
errors, make sure that it is exactly the same as the one that gave the
error. Also, please replace tabs with a few spaces (2-4 will do) since
it will reduce the number of broken lines and increase the readability.

--
Erik Wikström
Sep 26 '07 #5
On Sep 26, 1:54 pm, Erik Wikström <Erik-wikst...@telia. comwrote:
On 2007-09-26 03:39, andrey....@gmai l.com wrote:
static solver *encode(u8 *arr) {
solver *a = new solver();
pos_t i;
for (i = 0; i < width_sq; ++i) {
/* MAKE SURE that the number is between 1 and 9, inclusive so that
the
* solver does NOT mask 0 because that wouldbreak function isOK()
and
* hence prevent the solver from reaching a solution.
*/
if (width < 10) {
if (arr[i] >= 1 && arr[i] <= width)
a->set(i, arr[i]);
} else {
if (arr[i] >= 0 && arr[i] < width)
a->set(i + 1, arr[i]);
}
}
return a;
}
solver<cell_t, pos_t, width, width_rt, width_sq, val_mask, zb_len>::
That was a typo line
};

I took a new look at the code, and the line above is where my compiler
gave up, which is no surprise to me. When posting code that gives you
errors, make sure that it is exactly the same as the one that gave the
error. Also, please replace tabs with a few spaces (2-4 will do) since
it will reduce the number of broken lines and increase the readability.

--
Erik Wikström
The condensed class (with error-causing code) is:
template <typename cell_t = u16, typename pos_t = u8,
unsigned int width = 9, unsigned int width_rt = 3, int width_sq =
81,
cell_t val_mask = sumOfBits<u16, 9>::value, unsigned int zb_len =
11>
class solver {
public:
static unsigned char *solve (unsigned char *board) {
...
solution = false;
s = s->search();
if (solution) {
...
}
...
}
protected:
static bool solution;
...
solver *search(void) {
...
while (...) {
if (...) {
solution = true;
return this;
}
...
}
}
};

.... refers to code that the error does not apply to

Sep 26 '07 #6
an********@gmai l.com wrote:
On Sep 26, 1:54 pm, Erik Wikström <Erik-wikst...@telia. comwrote:
>On 2007-09-26 03:39, andrey....@gmai l.com wrote:
>> static solver *encode(u8 *arr) {
solver *a = new solver();
pos_t i;
for (i = 0; i < width_sq; ++i) {
/* MAKE SURE that the number is between
1 and 9, inclusive so that the
* solver does NOT mask 0 because that
would break function isOK() and
* hence prevent the solver from
reaching a solution. */
if (width < 10) {
if (arr[i] >= 1 && arr[i] <=
width) a->set(i, arr[i]);
} else {
if (arr[i] >= 0 && arr[i] <
width) a->set(i + 1,
arr[i]); }
}
return a;
}
solver<cell_t, pos_t, width, width_rt, width_sq, val_mask,
zb_len>::
That was a typo line
>>};

I took a new look at the code, and the line above is where my
compiler gave up, which is no surprise to me. When posting code that
gives you errors, make sure that it is exactly the same as the one
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^
>that gave the error.
^^^^^^^^^^^^^^^ ^^^^^
>Also, please replace tabs with a few spaces
(2-4 will do) since it will reduce the number of broken lines and
increase the readability.

--
Erik Wikström

The condensed class (with error-causing code) is:
template <typename cell_t = u16, typename pos_t = u8,
unsigned int width = 9, unsigned int width_rt = 3, int width_sq =
81,
cell_t val_mask = sumOfBits<u16, 9>::value, unsigned int zb_len =
11>
class solver {
public:
static unsigned char *solve (unsigned char *board) {
...
solution = false;
s = s->search();
if (solution) {
...
}
...
}
protected:
static bool solution;
...
solver *search(void) {
...
while (...) {
if (...) {
solution = true;
return this;
}
...
}
}
};

... refers to code that the error does not apply to
Do you by any chance NOT understand the meaning of the words I've
highlighted above in Erik's message? Read the FAQ 5.8 (and the rest
of section 5) before posting your reply, please.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Sep 26 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
10081
by: Rodolphe | last post by:
Hello, I'm French so sorry for my approximate English. When I try to compile a project under Visual C++ 6.0, I've got the following errors : applicap.obj : error LNK2001: unresolved external symbol _IID_ISampleGrabber applicap.obj : error LNK2001: unresolved external symbol _CLSID_NullRenderer applicap.obj : error LNK2001: unresolved external symbol
2
5604
by: Freddy | last post by:
I am not an experienced programmer, but I had a VC++ program I am trying to eliminate all the VC++ commands from it...and keeping it as a normal C/C++ program......I guess I have succeeded so far, but I am getting the unresolved external symbol errors, this is what I am getting: Linking... Test.obj : error LNK2001: unresolved external symbol "void __cdecl free_vector(double *)" (?free_vector@@YAXPAN@Z)
6
26367
by: Olivier Lechenne | last post by:
I am converting some projects from VS 6.0 to VS .NET 2003 and I get a linker error error LNK2001: unresolved external symbol ___security_cookie or error LNK2001: unresolved external symbol ___security_cookie Does anybody knows where does this symbol comes from? Is it because I am using a wrong library or have some bad compiler/linker options?
2
5329
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: 1>make_buildinfo.obj : error LNK2019: unresolved external symbol __imp__RegQueryValueExA@24 referenced in function _make_buildinfo2 Ask on python-list@python.org . - Josiah
6
121911
by: sadegh | last post by:
Hi I have a problem with my program in VC++6 When I compile it, the following errors are listed. I spend a lot of time on the groups.google.com to find its reason, but none of comments could not help me. Does any body know what is the problem?. Thanks. OtherFunctions.obj : error LNK2001: unresolved external symbol "int
0
2969
by: dotyet | last post by:
Hi Everyone, I am trying to build a DB2 UDB UDF which can perform regex over the table data. The user defined function will call an external .dll file to do the task. I am referring to the following link for doing so: http://www.ibm.com/developerworks/db2/library/techarticle/0301stolze/0301stolze.html While linking the below mentioned code, I am facing some errors. I have installed PCRE and am using Visual C++ 6.0 in 32-bit mode. The
0
2706
by: Ryan Gaffuri | last post by:
hlink72@hotmail.com (Eric) wrote in message news:<ab8d8b14.0308220550.54fb5f22@posting.google.com>... LNK1120 is a standard C++ error. you using Visual C++? Means your references a class that doesnt exist or something similiar to that. explanation on microsoft.com its not an oracle specific problem.
1
4097
by: Tharindu Madushanka | last post by:
When I am trying to run a Visual C++ program that uses DirectShow API I get the following errors. Can any body tell me how can I avoid getting this error. error: LNK2001: unresolved external symbol _IID_IMediaEvent error: LNK2001: unresolved external symbol _IID_IMediaControl error: LNK2001: unresolved external symbol _IID_IGraphBuilder
2
11482
by: hjazz | last post by:
Hi all, I'm new to VS, and I'm using Visual Studio .NET 2003. I'm trying to write a program which uses pcap libraries. However, I keep getting the following errors: error LNK2019: unresolved external symbol __imp__inet_ntoa@4 referenced in function _got_packet error LNK2019: unresolved external symbol __imp__ntohs@4 referenced in function _got_packet error LNK2019: unresolved external symbol _Search referenced in function _got_packet...
0
8840
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8730
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9215
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9131
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8007
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5981
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4484
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2130
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.