Page 1 of 1

Trouble Compiling with Command Line/Xcode

Posted: Tue Mar 24, 2015 8:13 pm
by myrilamica
So I'm not a very experienced coder, and I've never used Xcode before, so sorry if this seems basic.

I have XCode 6.1.1, Yosemite 10.10.2. I am using the example file from the Manual "hello Chipmunk (World)", with a few small changes because it seemed to have a few typos.

I've been trying to use command line to compile using gcc -o. When I do, I get this error,
"Undefined symbols for architecture x86_64:
"_cpBodyFree", referenced from:
_main in helloChipmunkSim-f44640.o
"_cpBodyGetPosition", referenced from:
_main in helloChipmunkSim-f44640.o
...
"_cpSpaceStep", referenced from:
_main in helloChipmunkSim-f44640.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

From googling, it seems like it may be a problem with the Xcode settings I'm using and not a problem with the code itself, but I've attached the file just in case.

If anyone can give me a walk through of how they set up the project/files in Xcode or point me towards a tutorial for this, I'd really appreciate it. Thanks!

Re: Trouble Compiling with Command Line/Xcode

Posted: Thu Apr 02, 2015 12:50 pm
by maximile
Not sure about doing it using gcc, sorry. But the chipmunk download contains an 'xcode' folder which contains a demo project - you can use that as a starting point to see how to get something building.