PDA

View Full Version : What steps




Miglu
Sep 2, 2010, 08:31 AM
How to make a C external library usable, besides adding it to the project folder?



iShater
Sep 2, 2010, 08:36 AM
What IDE, language are you using? In Java for example you have to have the library JAR file part of your CLASSPATH. We need more info. :)

Miglu
Sep 2, 2010, 09:35 AM
Objective-C.

mrbash
Sep 2, 2010, 09:35 AM
There really is no other way than adding it to your project. You would at the very least need the header definitions so you can use the functions but you would need a copy of the library when you create your object code.

Miglu
Sep 2, 2010, 09:40 AM
I meant what the steps in making it usable are, besides adding it to the project folder. I did it and added it to the frameworks folder in Xcode, but got several "symbol(s) not found" errors for methods in it. Then I added it to the Header Search Paths build configuration and still got the errors. Then I added it to the Other Linker Flags build configuration and still got the errors.

mrbash
Sep 2, 2010, 09:48 AM
I'm guessing its a pre-built library. The following link (http://www.rustyrazorblade.com/2008/02/external-libraries-in-xcode/)might be useful.

Miglu
Sep 2, 2010, 10:03 AM
That tutorial tells what I already tried. The library that I am trying to use is Chipmunk. I added it to the project folder and to the Xcode project. Then I added the word "chipmunk" to the Header Search Paths and "chipmunk/chipmunk.h" to the Other Linker Flags, but still got the errors.

mrbash
Sep 2, 2010, 11:46 AM
Just making sure, but did you add it as a pre-built library?

chown33
Sep 2, 2010, 12:16 PM
Post the complete error message text.

Is the library compiled for the same architecture your program is compiled for?

Is it a dynamic library or a static library?

Miglu
Sep 2, 2010, 12:39 PM
I do not know what a pre-built library is like, but I do not think that it is one.

Undefined symbols:
"_cpInitChipmunk", referenced from:
-[OpenGLView initWithFrame:] in OpenGLView.o
"_cpBodyNew", referenced from:
-[Ball2 init2] in Ball2.o
-[Ball init1] in Ball.o
"_cpSpaceNew", referenced from:
-[OpenGLView initWithFrame:] in OpenGLView.o
"_cpCircleShapeNew", referenced from:
-[OpenGLView initWithFrame:] in OpenGLView.o
-[OpenGLView initWithFrame:] in OpenGLView.o
"_cpBodyUpdatePosition", referenced from:
-[OpenGLView renderTimerCallback:] in OpenGLView.o
-[OpenGLView renderTimerCallback:] in OpenGLView.o
"_cpSpaceAddBody", referenced from:
-[OpenGLView initWithFrame:] in OpenGLView.o
-[OpenGLView initWithFrame:] in OpenGLView.o
"_cpResetShapeIdCounter", referenced from:
-[OpenGLView initWithFrame:] in OpenGLView.o
"_cpSpaceAddShape", referenced from:
-[OpenGLView initWithFrame:] in OpenGLView.o
-[OpenGLView initWithFrame:] in OpenGLView.o
"_cpBodyUpdateVelocity", referenced from:
-[OpenGLView renderTimerCallback:] in OpenGLView.o
-[OpenGLView renderTimerCallback:] in OpenGLView.o
ld: symbol(s) not found
collect2: ld returned 1 exit status