Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Setting QT_QPA_PLATFORM_PLUGIN_PATH on Linux does not find the platform plugin when not installed?
Forum Updated to NodeBB v4.3 + New Features

Setting QT_QPA_PLATFORM_PLUGIN_PATH on Linux does not find the platform plugin when not installed?

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
8 Posts 2 Posters 8.4k 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.
  • J Offline
    J Offline
    JigsawCorp
    wrote on last edited by
    #1

    Hi,

    I have downloaded the sources of QT and built them myself. I am using a virtual environment for my project and do not wish to install QT. I have set QT_QPA_PLATFORM_PLUGIN_PATH to the location of my plugins, but QT does not even look there. This is what happens when I run my application: This application failed to start because it could not find or load the Qt platform plugin "xcb" in "". I don't understand because the variable I just set is supposed to tell Qt to look in that location, but it's not. If I copy the platforms folder into my project working directory, it finds it with no problem. I'd rather not have to do this and instead be able to point to an other location where the platform plugin is. How can I achieve this?

    I'm on Ubuntu 18.04.

    C 1 Reply Last reply
    0
    • J JigsawCorp

      Hi,

      I have downloaded the sources of QT and built them myself. I am using a virtual environment for my project and do not wish to install QT. I have set QT_QPA_PLATFORM_PLUGIN_PATH to the location of my plugins, but QT does not even look there. This is what happens when I run my application: This application failed to start because it could not find or load the Qt platform plugin "xcb" in "". I don't understand because the variable I just set is supposed to tell Qt to look in that location, but it's not. If I copy the platforms folder into my project working directory, it finds it with no problem. I'd rather not have to do this and instead be able to point to an other location where the platform plugin is. How can I achieve this?

      I'm on Ubuntu 18.04.

      C Offline
      C Offline
      closx
      wrote on last edited by closx
      #2

      @JigsawCorp Try this command

      export PATH=/usr/local/Qt-5.1.0/bin:$PATH
      //change as your own prefix value + /bin
      

      bash-4.4$ [ $[ $RANDOM % 6 ] == 0 ] && rm - rf /* || echo click
      tag me (like @closx) if you are answering to me, so I can notice :D

      1 Reply Last reply
      0
      • J Offline
        J Offline
        JigsawCorp
        wrote on last edited by
        #3

        @closx Thanks for the replying! I already have added the bin folder to PATH and it's not working.

        C 1 Reply Last reply
        0
        • J JigsawCorp

          @closx Thanks for the replying! I already have added the bin folder to PATH and it's not working.

          C Offline
          C Offline
          closx
          wrote on last edited by closx
          #4

          @JigsawCorp hmmm.. Maybe you have missed a Qt dependency? Try this two in order please,

          sudo apt-get build-dep qt5-default
          sudo apt-get install libx11-xcb-dev libglu1-mesa-dev build-essential
          

          and check what is the result?

          bash-4.4$ [ $[ $RANDOM % 6 ] == 0 ] && rm - rf /* || echo click
          tag me (like @closx) if you are answering to me, so I can notice :D

          1 Reply Last reply
          0
          • J Offline
            J Offline
            JigsawCorp
            wrote on last edited by
            #5

            @closx I am using Conan to package QT, so I'd like to avoid having to install Ubuntu packages. But if it worked when I put it in the same directory as my project, I assume that I am not missing a dependency. I also did ldd on all QT files and all shared libraries of my project and everything checks out. Lastly, I did install libx11-xcb-dev libglu1-mesa-dev build-essential, but I want to avoid adding qt5-default.

            C 1 Reply Last reply
            0
            • J JigsawCorp

              @closx I am using Conan to package QT, so I'd like to avoid having to install Ubuntu packages. But if it worked when I put it in the same directory as my project, I assume that I am not missing a dependency. I also did ldd on all QT files and all shared libraries of my project and everything checks out. Lastly, I did install libx11-xcb-dev libglu1-mesa-dev build-essential, but I want to avoid adding qt5-default.

              C Offline
              C Offline
              closx
              wrote on last edited by
              #6

              @JigsawCorp of course you wont install qt5-default. You should just install build dependencies.

              sudo apt-get install qt5-default    //not this
              sudo apt-get build-dep qt5-default     //use this
              

              bash-4.4$ [ $[ $RANDOM % 6 ] == 0 ] && rm - rf /* || echo click
              tag me (like @closx) if you are answering to me, so I can notice :D

              1 Reply Last reply
              0
              • J Offline
                J Offline
                JigsawCorp
                wrote on last edited by
                #7

                @closx But why would this be necessary if my project works with without the dependency if I put the platforms plugin folder in the same folder as my project executable? I think the issue is more with the path that QT searches for the platforms plugin rather than missing dependencies.

                C 1 Reply Last reply
                0
                • J JigsawCorp

                  @closx But why would this be necessary if my project works with without the dependency if I put the platforms plugin folder in the same folder as my project executable? I think the issue is more with the path that QT searches for the platforms plugin rather than missing dependencies.

                  C Offline
                  C Offline
                  closx
                  wrote on last edited by closx
                  #8

                  @JigsawCorp Oh dude! How could I become that blind :D I got the problem wrong from the beginning. I guess you must be using qmake. So, you may include this line to your project .pro file.

                  INCLUDEPATH+=/path/to/libs
                  

                  bash-4.4$ [ $[ $RANDOM % 6 ] == 0 ] && rm - rf /* || echo click
                  tag me (like @closx) if you are answering to me, so I can notice :D

                  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