Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Modularized QT application - my program can't find .so files
Qt 6.11 is out! See what's new in the release blog

Modularized QT application - my program can't find .so files

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
3 Posts 3 Posters 672 Views
  • 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.
  • B Offline
    B Offline
    BSDUser
    wrote on last edited by
    #1

    I'm writing modularized application using QtCreator and QT 5.10. The program is being compiled using CLANG toolkit on an instance of GhostBSD (FreeBSD derivative).

    My program consists of serveral .so modules (let's say file1.so and file2.so) linked using -L option and the main binary.

    The problem I have is I can't start the main binary, because the program loader can't find file1.so and file2.so even if they are in the same directory as the main program.

    So the question is, how to install an output files (.so) into /usr/lib directory?
    My very first idea was to call make install as an extra build step, but it needs root.
    How to do that correctly?

    jsulmJ aha_1980A 2 Replies Last reply
    0
    • B BSDUser

      I'm writing modularized application using QtCreator and QT 5.10. The program is being compiled using CLANG toolkit on an instance of GhostBSD (FreeBSD derivative).

      My program consists of serveral .so modules (let's say file1.so and file2.so) linked using -L option and the main binary.

      The problem I have is I can't start the main binary, because the program loader can't find file1.so and file2.so even if they are in the same directory as the main program.

      So the question is, how to install an output files (.so) into /usr/lib directory?
      My very first idea was to call make install as an extra build step, but it needs root.
      How to do that correctly?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @BSDUser Take a look at http://doc.qt.io/qt-5/linux-deployment.html

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • B BSDUser

        I'm writing modularized application using QtCreator and QT 5.10. The program is being compiled using CLANG toolkit on an instance of GhostBSD (FreeBSD derivative).

        My program consists of serveral .so modules (let's say file1.so and file2.so) linked using -L option and the main binary.

        The problem I have is I can't start the main binary, because the program loader can't find file1.so and file2.so even if they are in the same directory as the main program.

        So the question is, how to install an output files (.so) into /usr/lib directory?
        My very first idea was to call make install as an extra build step, but it needs root.
        How to do that correctly?

        aha_1980A Offline
        aha_1980A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @BSDUser said in Modularized QT application - my program can't find .so files:

        The problem I have is I can't start the main binary, because the program loader can't find file1.so and file2.so even if they are in the same directory as the main program.

        On Windows it would work that way, but Unix explicitely forbidds loading libraries from the working directory - for security resaon. You can however, force the linker to load them anyway, e.g. by modifying LD_LIBRARY_PATH.

        So the question is, how to install an output files (.so) into /usr/lib directory?
        My very first idea was to call make install as an extra build step, but it needs root.

        Correct, but for testing that's not needed. Creator automatically extends LD_LIBRAY_PATH if the linker options are correctly set. So can you please show your projects .pro file?

        Regards

        Qt has to stay free or it will die.

        1 Reply Last reply
        3

        • Login

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