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. [Solved] Cannot include 3rd Party Mac .framework
QtWS25 Last Chance

[Solved] Cannot include 3rd Party Mac .framework

Scheduled Pinned Locked Moved Qt Creator and other tools
10 Posts 3 Posters 4.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.
  • L Offline
    L Offline
    leonardsouza
    wrote on last edited by
    #1

    I've spent the better part of two days trying to include a library in a Qt Creator 5.3 project. I've tried several methods, from the wizard to editing the qmake pro file to no avail.

    The framework is myo.framework and contains:

    Versions/A/Headers
    Versions/A/Resources (plist)
    Versions/A/myo (executable)

    Here's the wizard's qmake addition:

    mac: LIBS += -F$$PWD/../../../../../Downloads/sdk/ -framework myo

    INCLUDEPATH += $$PWD/../../../../../Downloads/sdk/myo.framework/Versions/A/Headers
    DEPENDPATH += $$PWD/../../../../../Downloads/sdk/myo.framework/Versions/A/Headers

    I've also tried setting

    QMAKE_LFLAGS += -F$$PWD/../../../../../Downloads/sdk/myo.framework
    LIBS += -F$$PWD/../../../../../Downloads/sdk/ -framework myo

    No matter what I do, I cannot #include <myo/myo.hpp>, which is how the library is structured in the plist. Any ideas? It works fine in Xcode and Visual Studio.

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

      Hi and welcome to devnet,

      What's the content of Headers ?

      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
      • L Offline
        L Offline
        leonardsouza
        wrote on last edited by
        #3

        I know the root subdir isn't myo, but this is how the imports are included in VS and Xcode.

        !https://www.evernote.com/shard/s233/sh/3c3dc8ba-8561-4356-ba87-f5c273bc02ff/0625c61b52df505df8a2a3462d9c8aad()!

        !https://www.evernote.com/shard/s233/sh/1a1f3c97-49ee-47e6-ab7c-47aac58b0781/f3029bac7e37661c87dbe47d5b2d2570()!

        !https://www.evernote.com/shard/s233/sh/b46c9968-3ab5-4489-885d-79a507066d28/b273427614050d2260c853ce406a9d47()!

        1 Reply Last reply
        0
        • L Offline
          L Offline
          leonardsouza
          wrote on last edited by
          #4

          Oops, those images didn't embed--looks like you can click on them They describe the headers.

          1 Reply Last reply
          0
          • L Offline
            L Offline
            leonardsouza
            wrote on last edited by
            #5

            This might be more helpful:

            !http://www.evernote.com/shard/s233/sh/166021f0-4c81-4717-8e45-8356dea92121/969aded9a2c2803e50b383ca16f9eef0()!

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

              If I saw things correctly, myo.hpp is in libmyo and not myo

              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
              • L Offline
                L Offline
                leonardsouza
                wrote on last edited by
                #7

                That's true, but #include <libmyo/myo.hpp> is still not found. I'm using:

                mac: LIBS += -F$$PWD/../../../../../Downloads/sdk/ -framework myo

                INCLUDEPATH += $$PWD/../../../../../Downloads/sdk/myo.framework/Versions/A/Headers
                DEPENDPATH += $$PWD/../../../../../Downloads/sdk/myo.framework/Versions/A/Headers

                Also, the headers within the Headers directory refer to <myo/*> and not libmyo. Any ideas?

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  leonardsouza
                  wrote on last edited by
                  #8

                  Ok, I got it to compile by placing those header into a myo directory, but now I have an rpath issue:

                  dyld: Library not loaded: @rpath/myo.framework/Versions/A/myo
                  Referenced from: /Users/lsouza/Documents/Dropbox/workspace/qt/build-ImportTest-Desktop_Qt_5_3_clang_64bit-Debug/ImportTest.app/Contents/MacOS/ImportTest
                  Reason: image not found

                  When running otool -L on myo (in sdk) I get: @rpath/myo.framework/Versions/A/myo

                  And when I run otool -L on the qt executable I get: @rpath/myo.framework/Versions/A/myo for the myo lib.

                  I can update the rpath using install_name_tool and point it to a static directory and run the app outside of Qt Creator without crashing. I want to run it from Qt Creator however. Is there a way to update the rpath on the built executable?

                  I placed the myo.framework inside my project and I believe I need to copy it to the build dir and update the rpath to that location. I'm new to Qt Creator, how would I do this?

                  1 Reply Last reply
                  0
                  • L Offline
                    L Offline
                    leonardsouza
                    wrote on last edited by
                    #9

                    Ok, instead I created a post build step to update the rpath reference using install_name_tool. It compiles and runs now. Thanks!

                    niqtN 1 Reply Last reply
                    0
                    • L leonardsouza

                      Ok, instead I created a post build step to update the rpath reference using install_name_tool. It compiles and runs now. Thanks!

                      niqtN Offline
                      niqtN Offline
                      niqt
                      wrote on last edited by
                      #10
                      This post is deleted!
                      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