QtCreator/Compiler cannot find header files.
-
Using QtSDK/Creator/Designer on 32-bit WinXP
I had been having success developing with QtCreator, and I wanted to publish my app as a stand-alone executable. I was unable to execute the "release" version without cloning the qtcore4.dll and qtgui4.dll into the same directory as the app.exe.
I googled and found a suggestion to add paths to the QtSdk..\bin files to the path. I did that, and my executable ran without requiring the dll files to be in the same directory .
But when I went back to QtCreator to do more editing, I noticed that the syntax higlighting for the QtGui and QtCore header files indicated that they did not exist, and, understandably, the syntax highlighting for the Qt class and namespace declarations indicated that they were undefined. Surely enough, the project would not build anymore. There are volumes of errors for undeclared identifiers.
Additionally, when trying to execute the ..\debug or ..\release executables from QtCreator, I get the following error ...
@
The process could not be started: The system cannot find the file specified.
@It's as if the whole Qt world fell apart by simply addiing to the path in the system environment variables.
I've tried changing so many things at this point, I don't know what I've done or where I'm at. I did not use the lab discipline of writing each step, as I was in a panic.
I loaded an example program, and, in spite of the syntax highlighting indicating that the headers don't exist, it compiled. But when trying to execute it, I got the same message ...
@
The process could not be started: The system cannot find the file specified.
@I re-installed the entire QtSDK from scratch, but the problem persists. Probably a registry setting somewhere, but I don't know where to look.
Please help.
-
I would not suggest to add QtSdk..\bin to the path, I suggest you remove it again.
The better way to run your executable from release folder is to put the needed dlls from QtSdk..\bin to that folder. They are needed at runtime and you also need them if you want to distribute the program to other pcs.There were already many topics on that on dev net, so I suggest you read:
"Deploying an Application on Windows":http://doc.qt.nokia.com/latest/deployment-windows.html.
"How to deploy my application using mysql plugin (Windows) ?":http://developer.qt.nokia.com/forums/viewthread/6204/
"General Deployment on Windows":http://developer.qt.nokia.com/forums/viewthread/6054/
On those links you also get some more lonks you can follow :-)
-
Thanks again.
In Options->Qt4-QtVersions, there are entries under "Auto Detected" and "Manual"
The first entry under "Manual", is ...
Version name: Qt 4.7.3 for Desktop - MSVC2008 (Qt SDK)
qmake location: c:\qtsdk\desktop\qt\4.7.3\msvc2008\bin\qmake.exeWhen I hover over that entry, I see ...
QT_INSTALL_HEADERS C:/qtsdk/desktop/qt/4.7.3/msvc2008/include
... which is a valid directory containing the header files.
There must be some other setting I'm missing that connects that entry to my project/session. But I just don't know what it is.
-
A couple other things.
Even though the project compiles and creates both debug and release executables, If I try to run them from the QtCreator, I get the message ...
@
Starting C:\Code\Projects\bits\bits-build-desktop\bits.exe...
The process could not be started: The system cannot find the file specified.
C:\Code\Projects\bits\bits-build-desktop\bits.exe exited with code 0
@
Why should QtCreator be looking in ..\bits-build-desktop for the .exe, when it should be looking in ..\bits-build-desktop\debug or release for it?
If I try to add \debug to the build directory, I get a warning that the build must be at the same level as the source, and QtCreator creates two new directories, ..\debug and ..\release under ..\bits-build-desktop\debug.What is that?
AND, I see these messages in the General Messages window, even though the build succeeds.
c:/qtsdk/symbian/sdks/symbian3qt473/mkspecs/symbian-sbsv2/qmake.conf(8): 'option' is not a recognized test function
c:/qtsdk/symbian/sdks/symbian1qt473/mkspecs/symbian-abld/qmake.conf(8): 'option' is not a recognized test function
Could not find qmake configuration file
Could not find qmake configuration file
Could not find qmake configuration file
Could not find qmake configuration file
Could not find qmake configuration file
Could not find qmake configuration file
Could not find qmake configuration file
Could not find qmake configuration file
Could not find qmake configuration file
Could not find qmake configuration fileThere seems to be one "could not find qmake configuration file" for each source file.
-
The build directory in QT Creator, is where you want your files to be placed. On Windows that includes the debug/release directories. Also, it seems like Qt Creator is trying to build your app for symbian. Did you mix up the directories when adding them to your PATH, so qt creator now uses the qmake for symbian?
-
This is my current path. There is no mention of Qt in there.
@
PATH=C:\Perl\site\bin;C:\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\Program
Files\Common Files\Roxio Shared\DLLShared;c:\Program Files\Common Files\Roxio Shared\DLLShared;c:
\Program Files\Common Files\Roxio Shared\9.0\DLLShared;C:\Program Files\Hewlett-Packard\IAM\bin;C:
Program Files\ActivCard\ActivCard Gold\resources;C:\Program Files\Common Files\Ulead Systems\MPEG;C:
\Program Files\jZip;c:\Program Files\Microsoft SQL Server\90\Tools\binn;C:\Program Files\OpenSSH\bi
n;C:\Program Files\QuickTime\QTSystem;C:\Program Files\Git\cmd;C:\Program Files\IDM Computer Soluti
ons\UltraEdit;C:\Program Files\IDM Computer Solutions\UltraCompare;C:\Program Files\OpenVPN\bin
@What is the appropriate path to add to my system path?
QtSDK is installed at c:\QtSDK, and all the msvc2008 directories are under c:\QtSDK\Desktop\Qt\4.7.3\msvc2008 -
I fear my QtCreator environment is hopelessly corrupted.
Who can tell me what the "vanilla' build environment is for QtCreator having the MSVC2008 engine resident on the system? I also have MinGW 4.4.
Nothing is working now. I can't build anything, the QtCreator cannot find its Headers, it's a real mess.
-
It is interesting that QtCreator can properly build my projects, while the QtCreator editor cannot locate the header files.
There must be a different environment variable for the QtCreator syntax editor. It's a great tool, when it's working, because of the hints and auto-completion.
I wish I knew what the problem is. If anyone has an idea about the correct settings for the editor, I would appreciate it.
-