PDA

View Full Version : GCC Error using Terminal




suphi
May 17, 2012, 10:15 AM
Hi,

I have a similar problem i think. Can anyone help me please?
I am using Xcode Version 4.3.2

I just tried to compile with gcc command my backgammon game on terminal. Here is the error message:

Undefined symbols for architecture x86_64:
"_InitBoard", referenced from:
_main in ccN5bK2w.o
"_DrawBoard", referenced from:
_main in ccN5bK2w.o
"_decideWhoStarts", referenced from:
_main in ccN5bK2w.o
"_RollDices", referenced from:
_main in ccN5bK2w.o
"_combinationOfPlayableSquaresWithDices", referenced from:
_main in ccN5bK2w.o
"_makeMove", referenced from:
_main in ccN5bK2w.o
"_isThereAnyWinner", referenced from:
_main in ccN5bK2w.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status



chown33
May 17, 2012, 10:25 AM
Post the exact Terminal command you used to compile your program.

Also, identify the exact .c files that make up your program. For example if there's a "main.c" and a "back.c", then say that. If there's only one .c file, say that.

suphi
May 17, 2012, 10:59 AM
Post the exact Terminal command you used to compile your program.

Also, identify the exact .c files that make up your program. For example if there's a "main.c" and a "back.c", then say that. If there's only one .c file, say that.

command: gcc main.c -o back
And i have 4 .c files. main.c, ai.c, play.c, debut.c.


Ah ok That was the problem. Thank u for remembering that.
it works with: gcc main.c ai.c play.c debut.c -o back