Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt Creator making shared library instead of executable
Forum Updated to NodeBB v4.3 + New Features

Qt Creator making shared library instead of executable

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 3.0k 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.
  • T Offline
    T Offline
    TheRealJ
    wrote on last edited by
    #1

    I am working as a trainee in a company tasked with migrating certain application from Qt 4 to Qt 5. I have made changed to the sources and now the project compiles successfully, but for some reason it always makes a shared library even though it should make an executable.

    I have checked the project settings and it clearly states "TEMPLATE = app" so it should be fine. I even tried creating a simple Qt Widget application and compiled it without any changes and even that is compiled into shared library, so something seems to be wrong in Qt Creator (or perhaps my installation).

    I am running Kubuntu 17.04 under VirtualBox, hosted under Windows 10. Qt Creator version is 4.4.1. I am used to using OpenSUSE at home, so I am not that familiar with Ubuntu (I installed Kubuntu instead of base Ubuntu, since I hate Unity). Could it be that my installation is missing some important package or I have configured it somehow wrong ?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Yea, I've recently noticed the same.

      The app should still run when you run it from cmd like this:

      ./yourExeName
      

      (Z(:^

      T 1 Reply Last reply
      0
      • sierdzioS sierdzio

        Yea, I've recently noticed the same.

        The app should still run when you run it from cmd like this:

        ./yourExeName
        
        T Offline
        T Offline
        TheRealJ
        wrote on last edited by
        #3

        @sierdzio ¨The demo does run, yes, but the actual application complains it can't find libqwt.so.6 (need to solve that problem as well). Running from terminal is not a long term solution, however, since it should be possible to just run the application by clicking on the icon (the application should in fact be usable both from GUI and from terminal, using command parameters for control in latter case). I think it is something about Kubuntu, since I have had no problems with OpenSUSE at home. Guess I'll have to try installing that.

        sierdzioS C 2 Replies Last reply
        0
        • T TheRealJ

          @sierdzio ¨The demo does run, yes, but the actual application complains it can't find libqwt.so.6 (need to solve that problem as well). Running from terminal is not a long term solution, however, since it should be possible to just run the application by clicking on the icon (the application should in fact be usable both from GUI and from terminal, using command parameters for control in latter case). I think it is something about Kubuntu, since I have had no problems with OpenSUSE at home. Guess I'll have to try installing that.

          sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          @TheRealJ said in Qt Creator making shared library instead of executable:

          [...] it should be possible to just run the application by clicking on the icon (the application should in fact be usable both from GUI and from terminal, using command parameters for control in latter case). I think it is something about Kubuntu, since I have had no problems with OpenSUSE at home. Guess I'll have to try installing that.

          Indeed. Please post here if you find a solution.

          In my case, I sometimes use a shell script to run the executable, and in other cases I do full deployment (using linuxdeployqt) with a .desktop file - then it works well and also adds icons to start menu etc.

          (Z(:^

          T 1 Reply Last reply
          0
          • T TheRealJ

            @sierdzio ¨The demo does run, yes, but the actual application complains it can't find libqwt.so.6 (need to solve that problem as well). Running from terminal is not a long term solution, however, since it should be possible to just run the application by clicking on the icon (the application should in fact be usable both from GUI and from terminal, using command parameters for control in latter case). I think it is something about Kubuntu, since I have had no problems with OpenSUSE at home. Guess I'll have to try installing that.

            C Offline
            C Offline
            ChrisW67
            wrote on last edited by
            #5

            @TheRealJ The Qwt runtime library needs to be on the system default library path, in a location on the path described by LD_LIBRARY_PATH, or in a location embedded in the application RPath (DT_RUNPATH section). A shell script launcher is the common approach to setting LD_LIBRARY_PATH in a portable fashion.

            1 Reply Last reply
            1
            • sierdzioS sierdzio

              @TheRealJ said in Qt Creator making shared library instead of executable:

              [...] it should be possible to just run the application by clicking on the icon (the application should in fact be usable both from GUI and from terminal, using command parameters for control in latter case). I think it is something about Kubuntu, since I have had no problems with OpenSUSE at home. Guess I'll have to try installing that.

              Indeed. Please post here if you find a solution.

              In my case, I sometimes use a shell script to run the executable, and in other cases I do full deployment (using linuxdeployqt) with a .desktop file - then it works well and also adds icons to start menu etc.

              T Offline
              T Offline
              TheRealJ
              wrote on last edited by
              #6

              @sierdzio My solution was to install OpenSUSE in VirtualBox and install Qt Creator on it. Worked like charm first time (well, I needed to install the GL library first). Seems like there is something fishy about Kubuntu...

              1 Reply Last reply
              0
              • H Offline
                H Offline
                hbatalha
                wrote on last edited by
                #7

                I know this is a very old post but I am stating my solution for newcomers and people running into the same issue in hopes it will help them.
                I also had this issue and my solution was to add this to my .pro file

                QMAKE_LFLAGS += -no-pie

                When I had this issue I tried everything suggested and this is the first one that worked. Then I went online to try to see why that worked but didn't find anything right away so I left as it was. Working.

                I can't find the link to the forum where I found this now, I had many tabs open then and didn't pay attention to the website name.

                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