Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Add IOKIT framework to *.pro file
Forum Updated to NodeBB v4.3 + New Features

Add IOKIT framework to *.pro file

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 2 Posters 2.9k Views 1 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.
  • C Offline
    C Offline
    cristeab
    wrote on last edited by
    #1

    Hi

    I am trying to use IOKIt framework in my macOS application developed with Qt5.9.1. I have added into the *.pro file this code

    LIBS += -framework IOKit

    but the compilation line does not contain any reference to this framework and IOKitLib.h file is not found. Can anyone tell me what I am doing wrong ?

    thanks
    Bogdan

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Did you re-run qmake after add the framework ?

      How are you including the headers from the framework ?

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

      1 Reply Last reply
      0
      • C Offline
        C Offline
        cristeab
        wrote on last edited by
        #3

        Hi
        Yes, I have rerun qmake. Following this link
        http://doc.qt.io/qt-5/qmake-platform-notes.html#using-frameworks
        no explicit path to IOKit framework header was added.

        Also, at compile time I can see 2 other frameworks from macOS being used, but not IOKit. Below is the error I get:

        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -std=gnu++11  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.10 -Wall -W -fPIC -DAPP_VERSION=\"6.0.7.4\" -DQT_QML_DEBUG -DQT_QUICK_LIB -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_MACEXTRAS_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I../FM -I. -I../FM/sources/FocusGroup -I../FM/headers -I../FM/sources/Controllers -I../FM/sources/Utils -I../FM/sources -I../../../Qt/5.9.1/clang_64/lib/QtQuick.framework/Headers -I../../../Qt/5.9.1/clang_64/lib/QtSvg.framework/Headers -I../../../Qt/5.9.1/clang_64/lib/QtWidgets.framework/Headers -I../../../Qt/5.9.1/clang_64/lib/QtMacExtras.framework/Headers -I../../../Qt/5.9.1/clang_64/lib/QtGui.framework/Headers -I../../../Qt/5.9.1/clang_64/lib/QtQml.framework/Headers -I../../../Qt/5.9.1/clang_64/lib/QtNetwork.framework/Headers -I../../../Qt/5.9.1/clang_64/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AGL.framework/Headers -I../../../Qt/5.9.1/clang_64/mkspecs/macx-clang -F/Users/b/Qt/5.9.1/clang_64/lib -o DialogTrayIcon.o ../FM/sources/Controllers/DialogTrayIcon.cpp
        ../FM/sources/Controllers/DialogTrayIcon.cpp:8:10: fatal error: 'IOKitLib.h' file not found
        

        Bogdan

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          What version of Xcode are you using ?

          Can you show how you include IOKitLib.h ?
          Can you show the complete .pro file for your project ?

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

          1 Reply Last reply
          0
          • C Offline
            C Offline
            cristeab
            wrote on last edited by
            #5

            Hi
            I am using latest Xcode version from macOS Sierra. Unfortunately I cannot post the entire *.pro file. However, after specifying in INCLUDEPATH IOKitLib.h path it seems that I can get past the above error.
            Bogdan

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Are you using #include <IOKitLib.h> or #include <IOKit/IOKitLib.h> ?

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

              1 Reply Last reply
              0
              • C Offline
                C Offline
                cristeab
                wrote on last edited by
                #7

                Just #include <IOKitLib.h>. The problem seems to solved, I just needed to add in INCLUDEPATH the path to the framework header and in LIBS "-framework IOKit"

                1 Reply Last reply
                0

                • Login

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