Important: Please read the Qt Code of Conduct -

Unable to link .so file

  • I have .so files (,,, which I copied to my executable's directory. In project settings I added

    @LIB += -lmyLib@

    and also set the LD_LIBRARY_PATH to point to where my .so files are located.

    I also tried

    @LIB += -L/home/me/ProjectFolder/-lmyLib@

    I always get this error:

    (.text.startup+0x39):-1: error: undefined reference to `MyLib::Test()'

    How can I use the .so file?

  • Maybe because your lib fails linux library naming convention?
    -l<libname> means what the linker should search for lib<libname>.{} and link it.
    -lmyLib - will search for libmyLib.{}, and if your library name is it will fail...

    You can try to point to the library file directly:

    LIB += /home/me/ProjectFolder/

Log in to reply