Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

simple linking to .dylib: how?



  • 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!


  • Lifetime Qt Champion

    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!


  • Lifetime Qt Champion

    On *nix systems, you drop the lib prefix when linking to a library. Like for example libz -> it's -lz.


Log in to reply