PDA

View Full Version : HELP! QtCreator can't find the QtSDK headers anymore!



paie
14th August 2011, 00:46
OK,

So I wanted to build a "release" executable.

I couldn't get the "release" version to run without cloning the qtgui4.dll and qtcore4.dll into the same directory as the "release" exe of the project.

I shoulda left well enough alone.

I went looking for how to make the app run without having to clone the dll files, and, according to the instructions I found, I added these directories to to my path.

C:\QtSDK\Desktop\Qt\4.7.3\msvc2008\bin;C:\QtSDK\De sktop\Qt\4.7.3\mingw\

Now the Qt Creator is acting as though all the QtSDK header files are not there anymore. It's putting wavy lines under all the Qt header files and the syntax highlighting for the Qt classes is gone. I tried adding the path to the QtSDK include files in my project, but no joy.

Can anybody tell me how to get back on track without having to re-install the QtSDK?

By the way, I did not type "De sktop", I typed "Desktop" for some reason that's how this web gui wants to display it. Very weird. Just not my day.

high_flyer
17th August 2011, 17:28
C:\QtSDK\Desktop\Qt\4.7.3\msvc2008\bin;C:\QtSDK\De sktop\Qt\4.7.3\mingw\
Not good, you are giving conflicting paths.
Either MSVC OR MinGW.
Also, your MSVC path is the bin path, and no headers can be found there.
Make sure you are giving the root of your Qt installation path.

paie
23rd August 2011, 03:14
> Make sure you are giving the root of your Qt installation path.

By root, do you mean to leave out \bin or \include ?

For example,

C:\QtSDK\Desktop\Qt4.7.3

... or should I be more explicit, with, as you suggest, just one header directory ...

C:\QtSDK\Desktop\Qt4.7.3\mingw\include

paie
23rd September 2011, 13:36
I still see wavy lines under the QtGui/ header files, for example,
#include <QtGui/QWidget>

And the mouseover says, "No such file or directory"

I took the following steps to try to fix this problem, but they failed to fix the problem.


uninstalled QtSDK.

removed from the registry all referenes to QtSDK and qtcreator.

Deleted any and all remaining QtSDK directories

ran a registry cleaner to delete any unused or dead-end keys.

rebooted.

downloaded and installed the latest install image Qt_SDK_Win_offline_v1_1_3_en.exe



When I installed, the installer provided a checkbox that asked if I wanted to remove all prior QtSDK settings. I checked the box, but I thought I had removed all traces of QtSDK from my system.

Anyway, I still have the problem where qtcreator cannot find the QtGui header files, yet the build executes without a hitch.

The QTDIR path is defined as
C:\QtSDK\Desktop\Qt\4.7.4\msvc2008\

I just cannot figure out what the problem is.

paie
23rd September 2011, 21:17
Added the following line to my project file ...


INCLUDEPATH += c:\QtSDK\desktop\qt\4.7.4\msvc2008\include


Absolute paths are bad, but it works for me.

There must be something missing in the environment that would allow the directories to be relative.

If anybody knows what might be missing, I would appreciate hearing from you.

wysota
23rd September 2011, 23:40
Does QtCreator properly detect your Qt versions? You define those by setting path to qmake from a particular Qt version and then Creator should be able to do the rest by itself.

paie
24th September 2011, 00:08
Wow, thanks for responding!


Does QtCreator properly detect your Qt versions?

How would I be able to determine that? The build completes without errors.


You define those by setting path to qmake from a particular Qt version and then Creator should be able to do the rest by itself.
You mean by adding something like the following to the end of the "path" environment variable in Windows?


c:\QtSDK\desktop\Qt\4.7.4\msvc2008\bin\qmake.exe;

That's the path to qmake.exe that I see in Tools->Options->Qt4->QtVersions

wysota
24th September 2011, 00:43
How would I be able to determine that?
Go to Tools > Options > Qt4 and take a look at "Qt versions" tab. If you want headers from QtSDK to be available, a version from QtSDK should be mentioned there. Remember the SDK consists of the toolchain (MinGW), Qt built for the toolchain and QtCreator along with Qt libs built for it. You shouldn't put any other Qt builds there, they are not part of the SDK, it's better to choose a separate directory so that you're sure nothing gets mixed. You can manually add all the Qt versions you have there by settings paths to appropriate qmake binaries.


You mean by adding something like the following to the end of the "path" environment variable in Windows?
No.

paie
24th September 2011, 01:04
Go to Tools > Options > Qt4 and take a look at "Qt versions" tab.
No.

Here is what I see there:



Auto-dedtected
Qt 4.7.4 for Desktopo - MSVC2008 (QtSDK) c:\qtsdk\desktop\qt\4.7.4\msvc2008\bin\qmake.exe
Simulator Qt for Visual Studio 2008 (QtSDK) c:\qtsdk\simulator\qt\msvc2008\bin\qmake.exe
Qt 4.7.4 for Symbian Belle (QtSDK) c:\qtsdk\symbian\sdks\symbiansr1qt474\bin\qmake.ex e
Qt 4.7.3 for Symbian ^3 (QtSDK) c:\qtsdk\symbian\sdks\symbian3qt473\bin\qmake.exe
Qt.4.7.3 for Symbian ^1 (QtSDK) c:\qtsdk\symbian\sdks\symbian1qt473\bin\qmake.exe
Manual
Simulator Qt for Visual Studio 2008 (Qt SDK) (2) c:\qtsdk\simulator\qt\msvc2008\bin\qmake.exe

wysota
24th September 2011, 01:10
This doesn't correspond to what you have written in the initial post. Can you explain that?

paie
24th September 2011, 01:20
This doesn't correspond to what you have written in the initial post. Can you explain that?
Yes, I'm sorry.

I explained part pf what I did in comment #4 above (http://www.qtcentre.org/threads/43891-HELP!-QtCreator-can-t-find-the-QtSDK-headers-anymore!?p=203891#post203891)

What I left out of that post is that I did not install mingw this time, because I thought it would simplify things. That is, I thought mingw would unnecessarily confuse things, since I already have msvc installed.

wysota
24th September 2011, 01:25
Which of the detected Qt versions do you use for your projects? Check, don't guess nor assume.

paie
24th September 2011, 01:36
Which of the detected Qt versions do you use for your projects? Check, don't guess nor assume.
In Projects->Build Settings I see ...



Edit build configuration: [ Qt 4.7.4 for Desktop - MSVC2008 (QtSDK) Debug ]

Qt version: [ Qt 4.7.4 for Desktop - MSVC2008 (QtSDK) ]

Tool Chain: [ Microsoft Visual C++ Compiler 9.0 (x86) ]