Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Unable to link .so file
Qt 6.12 LTS is out! See what's new in the release blog

Unable to link .so file

Scheduled Pinned Locked Moved Installation and Deployment
2 Posts 2 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I have .so files (myLib.so, myLib.so.1, myLib.so.1.0, myLib.so.1.1.0) 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?

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

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

      You can try to point to the library file directly:

      @
      LIB += /home/me/ProjectFolder/myLib.so
      @

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt
      • Unsolved