Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [SOLVED] Undefined symbols for architecture x86_64 when building hidapi
QtWS25 Last Chance

[SOLVED] Undefined symbols for architecture x86_64 when building hidapi

Scheduled Pinned Locked Moved Installation and Deployment
12 Posts 2 Posters 183.0k Views
  • 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.
  • H Offline
    H Offline
    Hedge
    wrote on 16 Oct 2012, 20:57 last edited by tekojo 3 Dec 2015, 13:21
    #1

    I've got a C-project (Qt Creator 2.5.2, Qt 4.8.2, OSX 10.7.5) and am trying to compile others among this file: https://github.com/signal11/hidapi/blob/master/mac/hid.c

    These are the first few lines of compiler-output:

    make: Entering directory '/Users/user/Documents/big_red_button'
    g++ -headerpad_max_install_names -arch x86_64 -Xarch_x86_64 -mmacosx-version min=10.5 -o BigRedButton.app/Contents/MacOS/BigRedButton main.o hidapi-mac.o dream_cheeky.o dream_cheeky_big_red_button.o      
    Undefined symbols for architecture x86_64:
      "_CFGetTypeID", referenced from:
          _get_int_property in hidapi-mac.o
      "_CFNumberGetTypeID", referenced from:
          _get_int_property in hidapi-mac.o
      "_CFNumberGetValue", referenced from:
          _get_int_property in hidapi-mac.o
      "_CFRelease", referenced from:
          _free_hid_device in hidapi-mac.o
          _hid_exit in hidapi-mac.o
          _hid_enumerate in hidapi-mac.o
          _hid_open_path in hidapi-mac.o
      "_CFRunLoopAddSource", referenced from:
          _read_thread in hidapi-mac.o
      "_CFRunLoopGetCurrent", referenced from:
          _init_hid_manager in hidapi-mac.o
          _read_thread in hidapi-mac.o
      "_CFRunLoopGetMain", referenced from:
          _hid_close in hidapi-mac.o
      "_CFRunLoopRunInMode", referenced from:
          _process_pending_events in hidapi-mac.o
          _read_thread in hidapi-mac.o
      "_CFRunLoopSourceCreate", referenced from:
          _read_thread in hidapi-mac.o
    

    What am I doing wrong?

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rcari
      wrote on 17 Oct 2012, 09:15 last edited by
      #2

      This is a linker problem. My guess would be that your -mmacosx-version-min=10.5 is conflicting somehow with your requirement to build with the x86_64 architecture.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rcari
        wrote on 17 Oct 2012, 09:16 last edited by tekojo 3 Dec 2015, 13:21
        #3

        Oups, sorry... You are missing a link to the CoreFoundation framework!

        LIBS += CoreFoundation
        
        1 Reply Last reply
        0
        • H Offline
          H Offline
          Hedge
          wrote on 17 Oct 2012, 15:43 last edited by tekojo 3 Dec 2015, 13:22
          #4

          Thank you. After adding it to the .pro file I get the error message:

          g++ -headerpad_max_install_names -arch x86_64 -Xarch_x86_64 -mmacosx-version min=10.5 -o BigRedButton.app/Contents/MacOS/BigRedButton main.o hidapi-mac.o dream_cheeky.o dream_cheeky_big_red_button.o     CoreFoundation 
          i686-apple-darwin11-llvm-g++-4.2: CoreFoundation: No such file or directory
          

          XCode and all required frameworks are installed though.

          1 Reply Last reply
          0
          • R Offline
            R Offline
            rcari
            wrote on 17 Oct 2012, 16:09 last edited by tekojo 3 Dec 2015, 13:23
            #5

            I am not a big fan/user of qmake so... Would you try
            LIBS += -framework CoreFoundation ?

            1 Reply Last reply
            0
            • H Offline
              H Offline
              Hedge
              wrote on 17 Oct 2012, 16:25 last edited by
              #6

              That one works but I get the same error as in the first post.

              1 Reply Last reply
              0
              • R Offline
                R Offline
                rcari
                wrote on 17 Oct 2012, 16:37 last edited by
                #7

                What version of Mac OS X are you running? Did you remove the minimum compatibility of 10.5?

                1 Reply Last reply
                0
                • H Offline
                  H Offline
                  Hedge
                  wrote on 17 Oct 2012, 16:40 last edited by
                  #8

                  I am on 10.7.4 and don't know how to remove the 10.5 requirement. QtCreator adds it automatically.

                  1 Reply Last reply
                  0
                  • R Offline
                    R Offline
                    rcari
                    wrote on 17 Oct 2012, 17:01 last edited by
                    #9

                    Could you please paste back the exact error message you have now?

                    1 Reply Last reply
                    0
                    • H Offline
                      H Offline
                      Hedge
                      wrote on 18 Oct 2012, 00:54 last edited by tekojo 3 Dec 2015, 13:25
                      #10

                      I didn't notice that it changed. It is now:

                      g++ -headerpad_max_install_names -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -o BigRedButton.app/Contents/MacOS/BigRedButton main.o hidapi-mac.o dream_cheeky.o dream_cheeky_big_red_button.o     -framework CoreFoundation 
                      Undefined symbols for architecture x86_64:
                        "_IOHIDDeviceClose", referenced from:
                      make: Leaving directory `/Users/ali/Documents/big_red_button/BigRedButton'
                            _hid_close in hidapi-mac.o
                        "_IOHIDDeviceGetProperty", referenced from:
                            _get_int_property in hidapi-mac.o
                            _get_string_property in hidapi-mac.o
                            _get_string_property_utf8 in hidapi-mac.o
                        "_IOHIDDeviceGetReport", referenced from:
                            _hid_get_feature_report in hidapi-mac.o
                        "_IOHIDDeviceOpen", referenced from:
                            _hid_open_path in hidapi-mac.o
                        "_IOHIDDeviceRegisterInputReportCallback", referenced from:
                            _hid_open_path in hidapi-mac.o
                            _hid_close in hidapi-mac.o
                        "_IOHIDDeviceScheduleWithRunLoop", referenced from:
                            _read_thread in hidapi-mac.o
                            _hid_close in hidapi-mac.o
                        "_IOHIDDeviceSetReport", referenced from:
                            _set_report in hidapi-mac.o
                        "_IOHIDDeviceUnscheduleFromRunLoop", referenced from:
                            _hid_close in hidapi-mac.o
                        "_IOHIDManagerClose", referenced from:
                            _hid_exit in hidapi-mac.o
                        "_IOHIDManagerCopyDevices", referenced from:
                            _hid_enumerate in hidapi-mac.o
                            _hid_open_path in hidapi-mac.o
                        "_IOHIDManagerCreate", referenced from:
                            _init_hid_manager in hidapi-mac.o
                        "_IOHIDManagerRegisterDeviceRemovalCallback", referenced from:
                            _hid_open_path in hidapi-mac.o
                            _hid_close in hidapi-mac.o
                        "_IOHIDManagerScheduleWithRunLoop", referenced from:
                            _init_hid_manager in hidapi-mac.o
                        "_IOHIDManagerSetDeviceMatching", referenced from:
                            _init_hid_manager in hidapi-mac.o
                      ld: symbol(s) not found for architecture x86_64@
                      
                      1 Reply Last reply
                      0
                      • R Offline
                        R Offline
                        rcari
                        wrote on 18 Oct 2012, 07:23 last edited by tekojo 3 Dec 2015, 13:23
                        #11

                        Alright, so just to give you a hint on how to solve those problems in the future...
                        Your missing symbols begin with IOHID. In Mac OS X all classes beginning with IO belong to the "I/O Kit":http://developer.apple.com/library/mac/#documentation/devicedrivers/conceptual/IOKitFundamentals/Introduction/Introduction.html.
                        Therefore, you can deduce that you are missing a link to the I/O Kit libraries or "framework".
                        Simply add this to your .pro file: LIBS += -framework IOKit

                        1 Reply Last reply
                        0
                        • H Offline
                          H Offline
                          Hedge
                          wrote on 18 Oct 2012, 07:24 last edited by
                          #12

                          Did that ten seconds ago and it finally compiles. Thanks for the help :)

                          1 Reply Last reply
                          0

                          1/12

                          16 Oct 2012, 20:57

                          • Login

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