tags:

views:

935

answers:

1

In my qmake .pro file I add my desired dynamic library to LIB which allows for compilation but doesn't link to the library in the compiled application (i.e. I get a library not found error at run time).

The problem is that I have the library in my build directory, not in the system directory (i.e. /usr/lib). But, I want to generate a OSX app that doesn't touch the system outside of the .app folder.

Also, I'd link to know how to do this on a linux system - is it possible?

My question is related to the Qmake generating a proper .app question but differs in that the link that answers that question doesn't answer my question.

+1  A: 

Put a wrapper script round your program so the current working directory is in the dynamic library search path:

#!/bin/bash
export  LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.
./program
PiedPiper
I was hoping to avoid using LD_LIBRARY_PATH but it looks like the best option for now. Thanks!
bias
How would I tell qmake to wrap the application with the script? Or, is the best bet to add the script by hand (which is kind of annoying)?
bias
You would have to add it by hand.
PiedPiper