Compiling libraries as sub-projects on OS X
I have an application which uses several internal libraries as sub-projects of the main project, which I reference using "Add library" within Qt Creator. This works fine for Windows when I choose "Run" from Creator, but on OS X I get errors that the libraries cannot be found. What's the best way to remedy this? I'd rather not have to copy the libraries to /usr/lib manually each time, as running cp as a custom step gives me "Permission denied" when I try to set it up to do this.
You have two possibilities here:
Set the install_name of your libraries at link times
Can I set DYLD_LIBRARY_PATH temporarily from the Project tab? I'm not 100% familiar with how things work on Mac (just got a MacBook a couple of days ago) but am familiar with Qt.
Sure you can: Project Panel -> Run -> Environment and there you can either update it or add it if it doesn't exists
I set the DYLD_LIBRARY_PATH variable to
and I still just get this:
@dyld: Library not loaded: libmodel.1.dylib
Referenced from: /Users/mac/Documents/fyp/crowbar/build-crowbar-Desktop_Qt_5_3_clang_64bit-Debug/sandbox01/sandbox01.app/Contents/MacOS/sandbox01
Reason: image not found
The program has unexpectedly finished.@
I'm not sure that the placeholders work there. I've always used the full paths
Aha, that seems to work. Thank you very much!
You're welcome !
Enjoy and happy coding ! :)