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.
-
Hi,
You have two possibilities here:
Use DYLD_LIBRARY_PATH
Set the install_name of your libraries at link times
-
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
@DYLD_LIBRARY_PATH:%{buildDir}/model:%{buildDir}/view@
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
-
You're welcome !
Enjoy and happy coding ! :)