04.11.08

Qt Errors and Answers

Posted in XP, Qt, Vista at 11:01 am by philwinder

This is a post containing all the problems I had installing and using Qt. Most of them can be fixed quite simply.

Qt:__________________________________________________________
Error: Qt does not compile certain programs on Windows Vista (In my case this was qwt)
Error Code: “gcc: installation problem, cannot exec `cc1′: No such file or directory”
Solution:

to solve the problem, you have just to add the following line in the Qt\bin\qtvars.bat :
SET PATH=%PATH%;C:\MinGW\libexec\gcc\mingw32\3.4.2
replace the last number with your actual version of gcc.
giminik-Vista Complie Errors

QDevelop:______________________________________________________
Error: Errors whilst compiling anything.
Error Code: Various
Solution:

Make sure that you have all the executables (GDB and ctags not vital to compile) locations (i.e. locations to the respective exe’s) in the Tools->External Tools menu. Note that the make exe is actually mingw32-make in the mingw32 folder.

Qwt Install:_________________________________________________
Note: For the following instructions please alter the file paths for your installation.
Follow the instructions in the install file. I had to cd to the qwt directory then “qmake qwt.pro” then “make”. Note: I could compile the examples, but I could not run them because they required some microsoft Visual C dll. (For the dll’s see later - they do work)

Once installed copy the file “C:\Qt\qwt-5.0.2\designer\plugins\designer\qwt_designer_plugin.dll” to “C:\Qt\4.3.4\plugins\designer”. Now the new widgets will be available in designer. Second add “C:\Qt\qwt-5.0.2\lib\qwt5.dll” to the “C:\Qt\4.3.4\bin” folder. This will enable your programs to compile correctly.

Finally, add a LIB path in whatever IDE you are using (or just the pro file) to the “C:\Qt\qwt-5.0.2\lib\libqwt5.a” file and add the header include path “C:\Qt\qwt-5.0.2\src”.
Note: The instructions said to add the “include” folder, but there was none so I just included the source folder.

Now if your on vista, then it compiles, but then crashes. This is because it cannot find some microsoft visual c dlls. I believe this is another path problem, so it might work for XP (I will test later). All we need to do is locate all of these dll’s and place them in the bin directory of your program. I had to add:
msvcp80.dll
msvcr80.dll
And also include the normal Qt dlls:
QtCore4.dll
qwt5.dll
QtGui.dll

The MS dlls can be downloaded here:Microsoft Visual C dll’.

Hopefully, finally, all is good. I believe most of these problems lie with Vista, so XP users should be ok.