Recently in the compilation of qt, before using debian6, gcc version is gcc-4.4, when using debian7, the compilation encountered a lot of different problems with debian6, debian7 default gcc uses gcc-4.7, this may be a problem with the compiler version. Therefore, you need to change the gcc version of debian 7 to debian.
Method 1:
Install gcc4.4 and g ++ 4.4
Copy codeThe code is as follows:
Sudo apt-get install gcc-4.4
Sudo apt-get isntall g ++-4.4
Modify the default gcc and g ++ version to 4.4.
Copy codeThe code is as follows:
Sudo update-alternatives -- remove-all gcc
Sudo update-alternatives -- install/usr/bin/gcc/usr/bin/gcc-4.4 40
Sudo update-alternatives -- install/usr/bin/g ++-4.4 40
Configure the default gcc and g ++
Copy codeThe code is as follows:
Sudo update-alternatives -- config gcc
Sudo update-alternatives -- config g ++
Method 2:
First, let's take a look at the gcc commands installed in your Debian: ls/usr/bin/gcc *-l my display is
Copy codeThe code is as follows:
Lrwxrwxrwx 1 root 7/usr/bin/gcc-> gcc-4.7
-Rwxr-xr-x 1 root 224544 2011-10-06/usr/bin/gcc-4.4
-Rwxr-xr-x 1 root 237072/usr/bin/gcc-4.5
-Rwxr-xr-x 1 root 302104/usr/bin/gcc-4.6
From the above display we can see that the default installation is gcc-4.7, now to change to gcc-4.4
Delete the soft connection file/usr/bin/gcc for the gcc-4.7. (Just delete the soft connection)
Command: sudo rm/usr/bin/gcc
Then a soft connection points to the gcc-4.4.
Command: sudo ln-s/usr/bin/gcc-4.4/usr/bin/gcc