Unsolved "symbol(s) not found for architecture x86_64" error when compiling a Qt project on Mac
-
@SGaist According to the debugger, the thing that's crashing is
const core::position2di& curr = ((CCursorControl *)CursorControl)->getPosition();
at line 1289 in the file CIrrDeviceMacOSX.mm. The part of my own code that calls this is the functionirr::createDeviceEx
, which is an Irrlicht function that I use in my code. Here is the complete code of the function that crashes (I added a comment at the line that crashes):void CIrrDeviceMacOSX::storeMouseLocation() { int x,y; if (Window != NULL) { NSPoint p; p = [NSEvent mouseLocation]; p = [Window convertScreenToBase:p]; x = (int)p.x; y = DeviceHeight - (int)p.y; } else { CGEventRef ourEvent = CGEventCreate(NULL); CGPoint point = CGEventGetLocation(ourEvent); CFRelease(ourEvent); x = (int)point.x; y = (int)point.y; const core::position2di& curr = ((CCursorControl *)CursorControl)->getPosition(); //This is the line that crashes if (curr.X != x || curr.Y != y) { // In fullscreen mode, events are not sent regularly so rely on polling irr::SEvent ievent; ievent.EventType = irr::EET_MOUSE_INPUT_EVENT; ievent.MouseInput.Event = irr::EMIE_MOUSE_MOVED; ievent.MouseInput.X = x; ievent.MouseInput.Y = y; postEventFromUser(ievent); } } ((CCursorControl *)CursorControl)->updateInternalCursorPosition(x,y); }
-
@Donald-Duck Most probably CursorControl is null pointer or dangling pointer. But I don't know why. Maybe you're doing something wrong in your code?
-
@jsulm That's not my code, it's Irrlicht's code. Irrlicht is a library that I'm using. I don't think there is anything wrong in my own code since it compiles and runs just fine on Windows and Linux.
-
Hence my suggestion to re-build Irrlicht against the same C++ library as Qt.
-
@Donald-Duck said in "symbol(s) not found for architecture x86_64" error when compiling a Qt project on Mac:
I don't think there is anything wrong in my own code since it compiles and runs just fine on Windows and Linux
From my own experience I know that such assumptions are often wrong :-)
But you should follow what @SGaist suggested. -
@SGaist I tried rebuilding libIrrlicht.a with libc++ and without adding
LIBS += -stdlib=libc++
andLIBS += -lc++
to my .pro file and it compiled and crashed just like first. It crashed at exactly the same place with exactly the same error. -
@jsulm I tested to see if the problem was in my code or in Irrlicht by copy-pasting a code from an Irrlicht tutorial that I know is correct into a new project and it crashed just like in my project. So the problem isn't in my code but in the Irrlicht library.
-
To be sure we're on the same page, you are calling
irr::createDeviceEx
and this crashes, right ? -
@SGaist Yes.
-
Since you are building Irrlicht anyway, I'd add some checks for CursorControl to see whether the pointer is null or just invalid.
-
@SGaist I checked and the pointer is null.
-
As a quick workaround to be able to run your application, add an if around the code using that variable.
The more involved method would be to find why it's null.
-
@SGaist said in "symbol(s) not found for architecture x86_64" error when compiling a Qt project on Mac:
The more involved method would be to find why it's null.
I've posted a question on the Irrlicht forum to find out why it's null: http://irrlicht.sourceforge.net/forum/viewtopic.php?f=7&t=51856&p=301630