liblrrlicht.a run on Mac happend crash

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
AndySenHu
Posts: 5
Joined: Fri Nov 25, 2016 3:53 am

liblrrlicht.a run on Mac happend crash

Post by AndySenHu »

i download the source code from branch-olg-es,then i use xcode8 build lrrlicht to generate a static library for my Mac(OSX 10.11), I open it's example and run helloWorld ,there happend crash. i do not know what is the matter about it, since i build for my iPhone ,run helloWorld-ios correctly.

issues:

Undefined symbols for architecture x86_64:
"irr::CIrrDeviceMacOSX::CIrrDeviceMacOSX(irr::SIrrlichtCreationParameters const&)", referenced from:
_createDeviceEx in libIrrlicht.a(Irrlicht.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

please give me an help, I do not how to deal with this matter,thanks,please?
MartinVee
Posts: 139
Joined: Tue Aug 02, 2016 3:38 pm
Location: Québec, Canada

Re: liblrrlicht.a run on Mac happend crash

Post by MartinVee »

Did you build the static library with "_IRR_OSX_PLATFORM_" defined?
AndySenHu
Posts: 5
Joined: Fri Nov 25, 2016 3:53 am

Re: liblrrlicht.a run on Mac happend crash

Post by AndySenHu »

thanks , I do not know what it is about "_IRR_OSX_PLATFORM_", Can you give me some detail step to build for my Mac.? please
AndySenHu
Posts: 5
Joined: Fri Nov 25, 2016 3:53 am

Re: liblrrlicht.a run on Mac happend crash

Post by AndySenHu »

now, I find the "_IRR_OSX_PLATFORM_", so i think it can not relate to this matter, in olg-es, i choose the project name "lrrlicht_OSX", then i build it, generate a static library for My Mac,but when i run helloworld, it crash this problem, i do not how to deal with it.
MartinVee
Posts: 139
Joined: Tue Aug 02, 2016 3:38 pm
Location: Québec, Canada

Re: liblrrlicht.a run on Mac happend crash

Post by MartinVee »

I never tried to build the OSX version of Irrlicht, so I can't be really specific, but the linker error you pasted seems to indicate the linker couldn't find the reference to CIrrDeviceMacOSX in the function call createDeviceEx. And regardless of the library, linker errors are always handled the same way.

The linker error you're receiving seems to indicate that either you didn't include the library correctly in your test project, or that the library doesn't compile correctly.

First, see if you included the library correctly. You said you recompiled the Irrlicht library yourself and then made a HelloWorld project, right? Did you check that the HelloWorld project has the correct Search Path for the version of the library you compiled? Check your Search Path for the HelloWorld project in XCode and see if it points to the correct libary, or check if another path with another version of the libary has precedence over your path.

Once you validated that you're including the correct library, check if the library build correctly. When I looked through the code, I saw that the CIrrDeviceMacOSX function is only compiled when you define the _IRR_OSX_PLATFORM_ macro. Can you confirm that the library builds correctly? Go in the CIrrDeviceMacOSX function, and add the following line inside the function :

Code: Select all

#error Stop.
Then recompile the Irrlicht library and see if this error happens when you compile. It should be. If not, it means you didn't compile the library for MacOSX.
Post Reply