Trouble Compiling with Command Line/Xcode

Official forum for the Chipmunk2D Physics Library.

Trouble Compiling with Command Line/Xcode

Postby myrilamica » Tue Mar 24, 2015 8:13 pm

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!
Attachments
helloChipmunkSim.c
(2.67 KiB) Downloaded 290 times
myrilamica
 
Posts: 1
Joined: Wed Mar 18, 2015 3:26 pm

Re: Trouble Compiling with Command Line/Xcode

Postby maximile » Thu Apr 02, 2015 12:50 pm

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.
maximile
 
Posts: 157
Joined: Mon Aug 20, 2007 12:53 pm
Location: London, UK


Return to Chipmunk2D Physics

Who is online

Users browsing this forum: No registered users and 4 guests