Centos7 installed Qt


1, the installation GCC compiler:
yum the install -Y-C GCC GCC ++

2, the installation linker:
yum -Y-libGL the install Mesa Mesa-devel-fine, the libGLU devel-devel-freeglut

3, download Qt
if you have gnome desktop, you can download a browser to access http://download.qt.io/archive/qt/ qt version to install, such as 5.9.8, here it is centos so I chose .run file and then copied to /table of Contents.
If it is a command line login, you can use wget to install
wget http://download.qt.io/official_releases/qt/5.9/5.9.8/qt-opensource-linux-x64-5.9.8.run

4, install Qt
cd / # enter the directory where the file downloaded run
chmod + x qt-opensource-linux-x64-5.9.8.run # add execute permissions on the installation file

5, configure the environment, the benefits do not need to run the program directly to the qt directory.

5.1 qt associated shared library is added to the library path /etc/ld.so.conf, regarding the shared library may refer ld.so.conf https://www.jianshu.com/p/98027a1f014d
/opt/Qt5.9.8 /5.9.8/gcc_64/lib
/opt/Qt5.9.8/Tools/QtCreator/lib

cat /etc/ld.so.conf
echo "/opt/Qt5.9.8/5.9.8/gcc_64/lib" >> /etc/ld.so.conf
echo "/opt/Qt5.9.8/Tools/QtCreator/lib" >> /etc/ld.so.conf
ldconfig
cat /etc/ld.so.conf

Alternatively, you can set the qtcreator in LD_LIBRARY_PATH, but this should be set up and pro association, other works do not see this setting

5.2 PATH environment variable
to set the environment variable methods varied, modified where / etc / profile for more reference https://www.cnblogs.com/franson-2016/p/6063226.html

CAT / etc / Profile
Vim / etc / Profile
locate the line export PATH then added /opt/Qt5.9.8/5.9.8/gcc_64/bin:/opt/Qt5.9.8/Tools/QtCreator/bin,
such as export PATH = / opt /Qt5.9.8/5.9.8/gcc_64/bin:/opt/Qt5.9.8/Tools/QtCreator/bin:/usr/local/lib:$PATH
Source / etc / Profile

 

Guess you like

Origin www.cnblogs.com/jsjrj01/p/10948305.html