View Single Post
jimz

 
Member Since: Apr 26, 2008
Posts: 4
jimz is on a distinguished road

jimz is offline
Hi,

I'm having trouble with an example from a C++ book.

Using eclipse 3.32 on OS X 10.4.11, gcc version 4.0.1, I get this error message:

Code:
**** Build of configuration Debug for project ticTacToe ****

make all 
Building file: ../src/ticTacToe.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/ticTacToe.d" -MT"src/ticTacToe.d" -o"src/ticTacToe.o" "../src/ticTacToe.cpp"
Finished building: ../src/ticTacToe.cpp
 
Building target: ticTacToe
Invoking: MacOS X C++ Linker
g++  -o "ticTacToe"  ./src/ticTacToe.o   
/usr/bin/ld: Undefined symbols:
displayBoard(std::vector<char, std::allocator<char> > const&)
collect2: ld returned 1 exit status
make: *** [ticTacToe] Error 1
I then tried to compile it in Xcode 2.2.1, and it compiles but then crashes soon after running with this error message:

Code:
ZeroLink: unknown symbol '__Z12displayBoardRKSt6vectorIcSaIcEE'

tictactoe has exited due to signal 6 (SIGABRT).
If I comment out this function and all calls to the function, I don't get any errors and it compiles and runs.

Code:
void dipslayBoard(const vector<char>& board)
{
	cout << "\n\t" << board[0] << " | " << board[1] << " | " << board[2];
	cout << "\n\t" << "--------";
	cout << "\n\t" << board[3] << " | " << board[4] << " | " << board[5];
	cout << "\n\t" << "--------";
	cout << "\n\t" << board[6] << " | " << board[7] << " | " << board[8];
	cout << "\n\n";
}
Any ideas?

Thanks,

Jim.
QUOTE Thanks