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. Sharedlib instead of executable file on ubuntu
QtWS25 Last Chance

Sharedlib instead of executable file on ubuntu

Scheduled Pinned Locked Moved Solved General and Desktop
15 Posts 6 Posters 8.2k 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.
  • F Offline
    F Offline
    FED27
    wrote on last edited by
    #1

    Hi to everyone,
    i've finished my qt project and i want to create an executable file.
    I'm using Qt 5.9.1 (qt creator 4.3.1).

    If a Run the project it produces me a sharedlib as main file, so i can run it calling from a terminal and it works but i can't click on the app icon in order to run it.

    is it my mistake?

    Thank you

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What do you mean by "it produces a shared lib as main file" ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • F Offline
        F Offline
        FED27
        wrote on last edited by
        #3

        When i build the project the only runnable file in the main folder is a application/x-sharedlib with the name of the project.

        1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi
          Can you post your .pro file?

          1 Reply Last reply
          0
          • F Offline
            F Offline
            FED27
            wrote on last edited by
            #5

            QT += core gui
            QT += charts

            greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
            QT+=printsupport

            TARGET = Interfaccia
            TEMPLATE = app

            DEFINES += QT_DEPRECATED_WARNINGS

            SOURCES +=
            main.cpp
            mainwindow.cpp
            mylabel.cpp
            ../build-Interfaccia-Desktop_Qt_5_9_1_GCC_64bit-Debug/qcustomplot/qcustomplot.cpp
            analizzatore.cpp
            particle.cpp

            HEADERS +=
            mainwindow.h
            mylabel.h
            ../build-Interfaccia-Desktop_Qt_5_9_1_GCC_64bit-Debug/qcustomplot/qcustomplot.h
            analizzatore.h
            datastore.h
            datastore.h
            particle.h

            FORMS +=
            mainwindow.ui

            1 Reply Last reply
            0
            • hskoglundH Offline
              hskoglundH Offline
              hskoglund
              wrote on last edited by
              #6

              Hi, also check that you have Shadow builds enabled in Qt Creator.

              1 Reply Last reply
              0
              • dheerendraD Offline
                dheerendraD Offline
                dheerendra
                Qt Champions 2022
                wrote on last edited by
                #7

                Looks like your double clicking on the executable and trying to run it. Are you getting the 'library not found' error ? if that is the case, Qt libraries may not be in the path. Please check the path and fix it

                Qn : Are you able to run your application from Qt Creator ?

                Dheerendra
                @Community Service
                Certified Qt Specialist
                http://www.pthinks.com

                1 Reply Last reply
                1
                • F Offline
                  F Offline
                  FED27
                  wrote on last edited by
                  #8

                  i've the "library not foung error" but if i run the app by terminal it works. Why?
                  How i can fix the path?

                  Yes i'm able to run my application from Qt Creator.

                  jsulmJ 1 Reply Last reply
                  0
                  • F FED27

                    i've the "library not foung error" but if i run the app by terminal it works. Why?
                    How i can fix the path?

                    Yes i'm able to run my application from Qt Creator.

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

                    @FED27 If you want your app to be runnable outside of QtCreator (or on other machines) you need to deploy it first.
                    See http://doc.qt.io/qt-5/linux-deployment.html

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

                    1 Reply Last reply
                    0
                    • F Offline
                      F Offline
                      FED27
                      wrote on last edited by
                      #10

                      i' m trying this way but when i launch the command qmake -config release it gives me
                      Project MESSAGE: Warning: unknown QT: charts

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        Hi,

                        As silly as it may sound, did you install all of Qt components ?

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0
                        • F Offline
                          F Offline
                          FED27
                          wrote on last edited by
                          #12

                          @SGaist solved but after i've launche the make and every is compiled i try to click on the app and the error is always "library not found"

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #13

                            Are you using a project template ?

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            0
                            • F Offline
                              F Offline
                              FED27
                              wrote on last edited by
                              #14

                              SOLVED i used QMAKE_LFLAGS += -no-pie in the .pro file and it produced me an executable file instead of a library

                              1 Reply Last reply
                              1
                              • SGaistS Offline
                                SGaistS Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote on last edited by
                                #15

                                Glad you found out and thanks for sharing !

                                Since you have it working now, please mark the thread as solved using the "Topic Tools" button so that other forum members may know what you are talking about.

                                Interested in AI ? www.idiap.ch
                                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                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 Extensions
                                • Unsolved