[Solved] Cannot include 3rd Party Mac .framework
-
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/HeadersI've also tried setting
QMAKE_LFLAGS += -F$$PWD/../../../../../Downloads/sdk/myo.framework
LIBS += -F$$PWD/../../../../../Downloads/sdk/ -framework myoNo 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.
-
Hi and welcome to devnet,
What's the content of Headers ?
-
I know the root subdir isn't myo, but this is how the imports are included in VS and Xcode.
-
Oops, those images didn't embed--looks like you can click on them They describe the headers.
-
This might be more helpful:
-
If I saw things correctly, myo.hpp is in libmyo and not myo
-
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/HeadersAlso, the headers within the Headers directory refer to <myo/*> and not libmyo. Any ideas?
-
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 foundWhen 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?
-
Ok, instead I created a post build step to update the rpath reference using install_name_tool. It compiles and runs now. Thanks!
-
This post is deleted!