Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. "symbol(s) not found for architecture x86_64" error when compiling a Qt project on Mac
Forum Updated to NodeBB v4.3 + New Features

"symbol(s) not found for architecture x86_64" error when compiling a Qt project on Mac

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
27 Posts 3 Posters 11.1k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SGaist
    Lifetime Qt Champion
    wrote on 12 May 2017, 16:30 last edited by
    #6

    From what I can see you must add to the LIBS variable the framework that Irrlicht requires like Core Foundation and the other concerned by the missing symbols messages.

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    D 1 Reply Last reply 13 May 2017, 08:01
    0
    • S SGaist
      12 May 2017, 16:30

      From what I can see you must add to the LIBS variable the framework that Irrlicht requires like Core Foundation and the other concerned by the missing symbols messages.

      D Offline
      D Offline
      Donald Duck
      wrote on 13 May 2017, 08:01 last edited by
      #7

      @SGaist How can I find out what framework that is?

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 13 May 2017, 20:33 last edited by
        #8

        You can search the missing symbols on the Apple developer website or google you'll get the matching framework there.

        Or take a look at the Irrlicht project files.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        D 1 Reply Last reply 13 May 2017, 21:40
        0
        • S SGaist
          13 May 2017, 20:33

          You can search the missing symbols on the Apple developer website or google you'll get the matching framework there.

          Or take a look at the Irrlicht project files.

          D Offline
          D Offline
          Donald Duck
          wrote on 13 May 2017, 21:40 last edited by Donald Duck
          #9

          @SGaist Thanks, I managed to get it to link almost all those symbols by adding the frameworks CoreFoundation, CoreGraphics and AppKit. But there are three that are still not working: std::_Rb_tree_decrement(std::_Rb_tree_node_base*), std::_Rb_tree_increment(std::_Rb_tree_node_base*) and std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&). I searched on Google for those but didn't find anything. What framework should I add to get those to work?

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 13 May 2017, 21:58 last edited by
            #10

            Can you check what standard library Irrlicht uses ? Libc++ or libstdc++ ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            D 1 Reply Last reply 14 May 2017, 10:40
            0
            • S SGaist
              13 May 2017, 21:58

              Can you check what standard library Irrlicht uses ? Libc++ or libstdc++ ?

              D Offline
              D Offline
              Donald Duck
              wrote on 14 May 2017, 10:40 last edited by Donald Duck
              #11

              @SGaist I tried libstdc++ and then those three symbols worked but there were a lot of others that stopped working. How can I use both libc++ and libstdc++ in the same project?

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 14 May 2017, 22:00 last edited by
                #12

                I'd rather go with building Irrlicht with libc++

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                D 1 Reply Last reply 15 May 2017, 10:25
                0
                • S SGaist
                  14 May 2017, 22:00

                  I'd rather go with building Irrlicht with libc++

                  D Offline
                  D Offline
                  Donald Duck
                  wrote on 15 May 2017, 10:25 last edited by Donald Duck
                  #13

                  @SGaist I added the following code in the .pro file and it compiled but it crashed at runtime:

                  LIBS += -framework CoreFoundation
                  LIBS += -framework CoreGraphics
                  LIBS += -framework AppKit
                  LIBS += -stdlib=libstdc++
                  LIBS += -lc++
                  

                  This is what I got in the terminal when running it:

                  Last login: Mon May 15 12:57:25 on ttys000
                  /Users/donaldduck/Documents/build-untitled/Mac/untitled.app/Contents/MacOS/untitled ; exit;
                  donalds-iMac:~ donaldduck$ /Users/donaldduck/Documents/build-untitled/Mac/untitled.app/Contents/MacOS/untitled ; exit;
                  Irrlicht Engine version 1.8.4
                  Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64
                  No doublebuffering available.
                  Segmentation fault: 11
                  logout
                  Saving session...
                  ...copying shared history...
                  ...saving history...truncating history files...
                  ...completed.
                  
                  [Process completed]
                  
                  
                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 15 May 2017, 19:57 last edited by SGaist
                    #14

                    You should run that through your debugger to see where exactly it's crashing.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    D 1 Reply Last reply 16 May 2017, 11:41
                    0
                    • S SGaist
                      15 May 2017, 19:57

                      You should run that through your debugger to see where exactly it's crashing.

                      D Offline
                      D Offline
                      Donald Duck
                      wrote on 16 May 2017, 11:41 last edited by Donald Duck
                      #15

                      @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 function irr::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);
                      }
                      
                      J 1 Reply Last reply 16 May 2017, 11:51
                      0
                      • D Donald Duck
                        16 May 2017, 11:41

                        @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 function irr::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);
                        }
                        
                        J Offline
                        J Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on 16 May 2017, 11:51 last edited by
                        #16

                        @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?

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        D 1 Reply Last reply 16 May 2017, 13:30
                        0
                        • J jsulm
                          16 May 2017, 11:51

                          @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?

                          D Offline
                          D Offline
                          Donald Duck
                          wrote on 16 May 2017, 13:30 last edited by
                          #17

                          @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.

                          J 1 Reply Last reply 17 May 2017, 04:17
                          0
                          • S Offline
                            S Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on 16 May 2017, 20:36 last edited by
                            #18

                            Hence my suggestion to re-build Irrlicht against the same C++ library as Qt.

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            D 1 Reply Last reply 17 May 2017, 09:22
                            0
                            • D Donald Duck
                              16 May 2017, 13:30

                              @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.

                              J Offline
                              J Offline
                              jsulm
                              Lifetime Qt Champion
                              wrote on 17 May 2017, 04:17 last edited by
                              #19

                              @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.

                              https://forum.qt.io/topic/113070/qt-code-of-conduct

                              D 1 Reply Last reply 17 May 2017, 09:28
                              0
                              • S SGaist
                                16 May 2017, 20:36

                                Hence my suggestion to re-build Irrlicht against the same C++ library as Qt.

                                D Offline
                                D Offline
                                Donald Duck
                                wrote on 17 May 2017, 09:22 last edited by
                                #20

                                @SGaist I tried rebuilding libIrrlicht.a with libc++ and without adding LIBS += -stdlib=libc++ and LIBS += -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.

                                1 Reply Last reply
                                0
                                • J jsulm
                                  17 May 2017, 04:17

                                  @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.

                                  D Offline
                                  D Offline
                                  Donald Duck
                                  wrote on 17 May 2017, 09:28 last edited by Donald Duck
                                  #21

                                  @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.

                                  1 Reply Last reply
                                  0
                                  • S Offline
                                    S Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on 17 May 2017, 11:47 last edited by
                                    #22

                                    To be sure we're on the same page, you are calling irr::createDeviceEx and this crashes, right ?

                                    Interested in AI ? www.idiap.ch
                                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                    D 1 Reply Last reply 17 May 2017, 12:07
                                    0
                                    • S SGaist
                                      17 May 2017, 11:47

                                      To be sure we're on the same page, you are calling irr::createDeviceEx and this crashes, right ?

                                      D Offline
                                      D Offline
                                      Donald Duck
                                      wrote on 17 May 2017, 12:07 last edited by
                                      #23

                                      @SGaist Yes.

                                      1 Reply Last reply
                                      0
                                      • S Offline
                                        S Offline
                                        SGaist
                                        Lifetime Qt Champion
                                        wrote on 17 May 2017, 12:22 last edited by
                                        #24

                                        Since you are building Irrlicht anyway, I'd add some checks for CursorControl to see whether the pointer is null or just invalid.

                                        Interested in AI ? www.idiap.ch
                                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                        D 1 Reply Last reply 17 May 2017, 13:07
                                        0
                                        • S SGaist
                                          17 May 2017, 12:22

                                          Since you are building Irrlicht anyway, I'd add some checks for CursorControl to see whether the pointer is null or just invalid.

                                          D Offline
                                          D Offline
                                          Donald Duck
                                          wrote on 17 May 2017, 13:07 last edited by
                                          #25

                                          @SGaist I checked and the pointer is null.

                                          1 Reply Last reply
                                          0

                                          15/27

                                          16 May 2017, 11:41

                                          • Login

                                          • Login or register to search.
                                          15 out of 27
                                          • First post
                                            15/27
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved