simple linking to .dylib: how?
Solved
General and Desktop
-
in my .pro file i have this:
DIR_BOOST = $${DIR_EXTERNAL}boost_1_68_0/ DIR_BOOST_LIBS = $${DIR_BOOST}stage/lib/ DYLD_LIBRARY_PATH += $${DIR_BOOST_LIBS} LIB_BOOST_THREAD = libboost_thread LIBS += -l$${LIB_BOOST_THREAD}
yet at compile time i get this:
ld: library not found for -llibboost_thread
i started with:
LIBS += -L$${DIR_BOOST_LIBS} -l$${LIB_BOOST_THREAD}
but that also fails.
i have confirmed that the path is definitely correct, and the file "libboost_thread.dylib" definitely exists there and is compiled correctly
the linker is sent this command:
-L../../../External/boost_1_68_0/stage/lib/ -llibboost_thread
is it that the path must be absolute (not relative) ?
what am I missing?
-
oh! huh. that's not the name used in the file system, which is why i was (am?) confused. thanks, that worked!
-
Hi,
It's
-lboost_thread
like on Linux. -
oh! huh. that's not the name used in the file system, which is why i was (am?) confused. thanks, that worked!
-
On *nix systems, you drop the
lib
prefix when linking to a library. Like for examplelibz
-> it's-lz
.