[MacOSX] How to build a new project with compiled library?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Masterhawk
Posts: 299
Joined: Mon Nov 27, 2006 6:52 pm
Location: GERMANY
Contact:

[MacOSX] How to build a new project with compiled library?

Post by Masterhawk »

Hey folks,

can anybody tell me how to link a static library under MacOSX and XCode 4 correctly without having the static library project added as a target? I want to compile Irrlicht projects with simply the a-file, the necessary include directory and the program code.

I set up a vanilla Cocoa-project in XCode, added the include files and added the correct library search path in the build settings, but it still fails at building due to linking errors.
I added the libIrrlicht.a file under "Linked Frameworks and Libraries" and "Link Binary With Libraries".
In the Build Settings I set the "Header Search Paths" and the "Library Search Path" correctly.
Since I down have the project of the static library in my current project I cannot use it as target dependency.

Does anyone have a clue what I can try to compile a application with simply the a-file and the irrlicht include directory?

EDIT: The program only contains a main function with a createDevice-statement. Here is a picture of the occuring errors
Image
Image
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: [MacOSX] How to build a new project with compiled librar

Post by Nadro »

This issue is probably related to different "-stdlib" settings in project settings. Are you sure that you also set the same architectures target (and build only for active architecture flag) for both library and application?

For example in Android NDK when you set std=gnu++11 and statically link library to application _Rb_tree_decrement etc. are also missing, so try to switch to other std flag, it should help.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Masterhawk
Posts: 299
Joined: Mon Nov 27, 2006 6:52 pm
Location: GERMANY
Contact:

Re: [MacOSX] How to build a new project with compiled librar

Post by Masterhawk »

Well thank you so much. That was exactly the problem. I wouldn't have figured this out on myself ;)
Image
Post Reply