Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

suphi

macrumors newbie
Original poster
May 17, 2012
2
0
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
 
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.
 
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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.