Go Back   The macosxhints Forums > Working with OS X > OS X Developer



Reply
 
Thread Tools Rate Thread Display Modes
Old 11-07-2009, 03:07 PM   #1
ahesa
Prospect
 
Join Date: Nov 2009
Posts: 2
Help using a static library with XCode

Hi.

I hope I am posting this in the right place...
So here it goes. I am trying to make an iPhone/PC C++ application work on a iMac with MAC OS X 10.5. The application uses SOIL to load .png images on the PC. I would like to use SOIL on the Mac too since it is supposedly a multiplatform library.

I have linked the following to xCode project : libSOIL.a, Cocoa.framework, GLUT.framework and OpenGL.framework. I have added #include <SOIL.h> to my stdafx.h file which is included in all my classes and the header search path $(SRCROOT)/soil/src where is located the only SOIL.h file on my machine.

Now, everything compiles fine except that when the application is in the linking phase I get the following error :

"_SOIL_load_OGL_texture" referenced from :
"_SOIL_free_image_data", referenced from :
"_SOIL_load_image", referenced from :

I had similar problems using iconv but when I added libiconv.2.dylib to my xCode project, it corrected them. So I thought adding libSOIL.a would do the trick but apparently it is not where the problem is.

Anyone has any idea about how to link a static library (.a file) in xCode or a link to a tutorial. Maybe just tell me what is difference between linking .a versus linking a dylib since the latter works... Google was not much help so far.
ahesa is offline   Reply With Quote
Old 11-07-2009, 04:42 PM   #2
ahesa
Prospect
 
Join Date: Nov 2009
Posts: 2
All right.. xcode kind of "owned" me there. Instead of linking the libSOIL.a file, all I had to do was actually to add everything .h and .c in soil/src in my xCode project to make it work. I am still wondering what's the use of making a .a file it is not working anyway ??
ahesa is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 04:54 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Site design © Mac Publishing LLC; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of Mac Publishing LLC.