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. QtWidget app doesn't build as executable

QtWidget app doesn't build as executable

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 690 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.
  • S Offline
    S Offline
    ScottHamilton
    wrote on last edited by
    #1

    Hey!
    First I'm on linux ubuntu 18.04, using Qt 5.11.1 with QtCreator 4.7.2
    I've got a probleme with a Qt app, it builds well and exeucute well but when I double click
    on it in the file manager, iit opens the file as a text file.

    It seems like the app has been build as a library.

    Thanks for your help.

    mrjjM 1 Reply Last reply
    0
    • S ScottHamilton

      Hey!
      First I'm on linux ubuntu 18.04, using Qt 5.11.1 with QtCreator 4.7.2
      I've got a probleme with a Qt app, it builds well and exeucute well but when I double click
      on it in the file manager, iit opens the file as a text file.

      It seems like the app has been build as a library.

      Thanks for your help.

      mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi and welcome to the forums.
      Well if it can executes, it cant be a library ?
      Try navigation to the build folder with a shell and start it from there and see what happens.

      Also, check the pro file
      what
      TEMPLATE = app
      says

      1 Reply Last reply
      1
      • S Offline
        S Offline
        ScottHamilton
        wrote on last edited by
        #3

        Hey, yes it runs well in terminal with ./MyApp and here is my full .pro file :
        https://pastebin.com/69CBKxuT

        mrjjM 1 Reply Last reply
        0
        • S ScottHamilton

          Hey, yes it runs well in terminal with ./MyApp and here is my full .pro file :
          https://pastebin.com/69CBKxuT

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @ScottHamilton
          hi
          Should be an app then . seems your OS opens an executable in
          text editor then. I have seen this with .sh scripts but not
          binary "exe" files. But Qt/app is fine. Its an OS thing.

          1 Reply Last reply
          1
          • S Offline
            S Offline
            ScottHamilton
            wrote on last edited by
            #5

            Ok, I've got new data :

            First, I tested the application on a brand new linux laptop and it does have the same problem.
            So it's either a problem with ubuntu or a problem with Qt (lets talk seriously, the second one is the most likely).

            Second, I created a new Qt widget project with the QtCreator template project of the same name.
            and it has the same problem.

            Then I reinstalled completely Qt and retried everything, and same problem.

            Finally I renamed the file with an .appimage at the end, and the problem just disappear, it show the binary icon in the file manager, and when we double click on it, it opens fine!!!

            So, seems it a problem with linux.

            Conclusions

            If you are in the same situation, just rename your executable with an .appimage at the end.

            1 Reply Last reply
            1

            • Login

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