"QT is not correctly installed,
Run make install"
Solution for "invalid QT version"
Well, if you encounter this situation, I believe your QT version is copied. This is also the case. I tried to copy the QT version to another path, but I found that qtcreator could not recognize it. However, the following methods can help you get rid of such troubles. It was also developed by me not long ago. The core is to modify executable qmake.
First, you need to analyze the situation as shown in. Why can't this problem occur during installation, but when we change the path? The path is not correct. Let's take a look at the details of available QT versions.
We can see a lot of environment variables related to QT, so I want to search related environment variables in the mkspecs folder. However, I searched the mkspecs folder several times without any gains. Why?
It turns out that QT is really high. During the installation of QT, qmake was compiled and the relevant path was embedded in the qmake code. Did you say we had nothing to gain after looking for a long time! Well, as the saying goes, "You are a tall ruler, I'm a tall one." I decided to modify the qmake executable file.
First, let's see what qmake has. Use the built-in binary editor of qtcreator to open it.
/Home/jiangcaiyang/programs/qtsdk is the directory during installation, but I changed it to/home/jiangcaiyang/programs/qt4.8.4, and qmake does not work, no wonder the QT version is invalid.
Now we need to modify it.. If the built-in binary editor of qtcreator cannot modify the binary file, we have to download the editor ourselves. Here we download the bless binary Editor, which is widely praised by the Ubuntu Software Center (you can download it from the Ubuntu software center if necessary ). Back up qmake, open bless, load qmake, and press Ctrl + R to replace. Note that if the number of bytes in your path is greater than the number of bytes in the original path, delete the following padding values: 0, if the number of path bytes is smaller than the original number of path bytes, you need to add a number of zeros to avoid segment errors. At the beginning, I encountered such an error. The following is my modified interface:
Save or save the changes as needed (if you save the changes as needed, you need to manually add permissions for the new qmake, either using chmod + X or using Nautilus (the resource manager that comes with UBUNTU ). Copy the new qmake to/home/jiangcaiyang/programs/qt4.8.4/bin and re-load it in the options!
Note: This method is a last resort, because I have not studied how to compile QT. Maybe there will be a better way. However, this will stop us from sticking to the fixed path QT version. If we want to build our own QT portable development environment, I believe this "soil" method will certainly help.