Qt5 distributable on linux

  • Hi,
    I've installed Qt5 on my Linux box but I'm a little confused about the directory it uses. My understanding is that shared libraries like Qt should live in '/usr/lib' and their include files should live in 'usr/include'. This was the case for Qt4, which I installed using the command line: 'sudo apt-get install libqt4-dev qt4-qmake cmake r-base-dev libcurl4-gnutls-dev'. This seems to put things in the right place.
    However, the graphical installer (which I downloaded from "here":https://qt-project.org/downloads) lets you specify any old directory and doesn't then copy the libraries and user headers in to the right directories. Am I missing something or am I supposed to do this manually?

    Thanks for your time,

  • Yes, the former packages provided by your linux distribution, while the latter is provided by the Qt project.

    You can wait for your linux distribution to provide the Qt5 package, then you can use "sudo apt-get install " to install Qt5.

    You can also download the latest Qt4 version(for example Qt4.8.5) from qt project, then install it, so it can co-exist with your system provided not so-new Qt4.

  • I believe that g++ accepts -I switch witch will tell it where to look for additional headers files and -L where to look for additional libraries (which will be wherever you installed the Qt5 sdk) besides the default ones. When you run the qmake It will generate the makefiles to build your Qt application.

  • Thanks for the replies. That's what I figured - I'm telling the compiler to look in my directory but I'm concerned about what to do when I redistribute the library. I'm not sure how to tell my executable to look in a relative directory for the library or to use an environment variable. This is more of a general problem than just a Qt one - I'm not sure how Linux looks for shared libraries ('.so' files) other than using the LD_LIBRARY_PATH environment variable.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.