Trouble Compiling with Command Line/Xcode

Official forum for the Chipmunk2D Physics Library.
Post Reply
myrilamica
Posts: 1
Joined: Wed Mar 18, 2015 3:26 pm
Contact:

Trouble Compiling with Command Line/Xcode

Post 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!
Attachments
helloChipmunkSim.c
(2.67 KiB) Downloaded 646 times
maximile
Posts: 157
Joined: Mon Aug 20, 2007 12:53 pm
Location: London, UK
Contact:

Re: Trouble Compiling with Command Line/Xcode

Post 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.
Post Reply

Who is online

Users browsing this forum: Heise IT-Markt [Crawler] and 13 guests