Ubuntu18.04 ARM compiles and installs qt, qtcreator, and how to resolve exceptions during operation

Here is Ubuntu18.04 ARM, compiled and installed qt 5.9.7, qtcreator 4.7.1 

1. Prepare qt and qtcreator source packages, 

        qt 5.9.7 download address: Click to download

        qtcreator 4.7.1 download address: click to download

2. Installation dependencies

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install gperf
sudo apt-get install libxcb*
sudo apt-get install build-essential libgl1-mesa-dev libglu1-mesa-dev libegl1-mesa-dev freeglut3-dev
sudo apt-get install flex
sudo apt-get install bison
sudo apt-get install libx11-dev libxext-dev libxtst-dev
sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev
sudo apt-get install libxkbcommon-x11-dev

3. Install qt

 3.1 Decompress the downloaded qt source code and enter the decompressed directory

 3.2 The decompression command has two lines, because there are two layers of compression, or GUI operation, right click - extract here                

xz -d qt-everywhere-opensource-src-5.9.7.tar.xz
tar -xvf qt-everywhere-opensource-src-5.9.7.tar

   3.3 After decompression, enter the directory and execute the script

cd qt-everywhere-opensource-src-5.9.7
./configure

There may be an error report make: ***[module-qtbase-make_first] Error 2

Solution: Execute make clean
and then clear the QT source code files, clear the temporary files generated by compiling QT, restart, and release the Qt source code again

     3.4 Select version (o) and accept agreement (y)

     3.5 Compile, if it is slow, use multi-threading, multi-threading will be very stuck and may cause errors, it is recommended to hang up and make

          Compile 3 ~ 12 hours 

make
或者
make -j2 

 Error: makefile:638:recip for target "xxxxxxx" failed

Solution: Execute make clean
to clear the temporary files generated during compilation, create a temporary folder in the source code directory, compile again in the temporary folder, modify and place the directory after compiling

报错: make:***[Makefile:337:module-qtdeclarative-make_first] Error 3

Solution: python may be replaced by python2 or python3, resulting in no mapping.
 ls /usr/bin/python* Check if there is python or not,
create a soft link: ln -s /usr/bin/python3 /usr/bin/python

      3.6 Installation The default installation directory is under /usr/local/

sudo make install 

       3.7 Configure environment variables and open the configuration file

sudo vim /etc/profile

        3.8 Write environment variables and add the following content to the end of the configuration file

(Note that the installation path fills in the actual installation path to avoid mistakes)

export QTDIR = /usr/local/Qt-5.7.1
export PATH = $QTDIR/bin:$PATH
export MANPATH = $QTDIR/man:$MANPATH
export LD_LIBRARY_PATH =  $QTDIR/lib:$LD_LIBRARY_PATH

        3.9 Enabling environment variables to take effect

source /etc/profile

        3.10 Verify whether it is in effect, normally there will be version information output

qmake -v

4 Install QtCreator

        4.1 Unzip qt-creator-opensource-src-4.7.1.tar.gz to the current directory         

tar -zxvf qt-creator-opensource-src-4.7.1.tar.gz

        4.2 Enter the decompressed directory and create a temporary directory, enter the temporary directory

cd qt-creator-opensource-src-4.7.1
mkdir build
cd build

        4.3 Start compiling, if compiling is slow, use multithreading, make - j2 

        It takes a long time to compile, it is recommended to hang up make 

qmake -r
make 

        4.4 Installation

sudo make install

        4.5 After installation, you can open QtCreator

        May report an error: Cannot find.... makefile recipe....

        Solution: Delete the makefile in the build directory.
                        Under the QtCreator build settings, set the build environment and
                        clear the system environment variables✔

 QtCreator - Project - Build Settings - Build Environment - Details - Clear System Environment Variables

After adding the project, an error may be reported when starting qt-creator: Failed to overwrite xxxx file

Solution: Give permission when running QtCreator

Start qt-creator using command line
sudo ./qtcreator

qtcreator may be in (in /usr/bin or /bin/ directory), 

Or use whereis qtcreator to find the path

ps: I installed two qtcreators here, and the Chinese garbled characters installed with the source code, so I installed another one with the command line

Guess you like

Origin blog.csdn.net/qq_39085747/article/details/128671534