On 7/10/07, B. Carrupt <[EMAIL PROTECTED]> wrote:


It's working now, thanks. I had to add /usr/local/lib in ld.so.conf
(don't know why it's not there by default) so that the wx libraries
could be found.

What I don't understand is why it was working when I ran the binary
from the build/bin directory of cmake directly (or when I copied it
manually to the location).


When linking the executable in your build directory, cmake explicitly passes
a `-rpath'  option to the compiler/linker. On my system the gcc command
looks like this:

/usr/bin/gcc -fPIC "CMakeFiles/main.dir/main.o" -o bin/main -rdynamic
-L/xxx/build/lib -lhello -Wl,-rpath,/xxx/build/lib

You can run ldd on the executable in the build directory and see exactly
which library it depends on. It should be the library in the build directory
other than `/usr/local/lib'.

Thank you for the ldd command, it's really useful !

B. Carrupt
_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to