Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. QtCreator/Compiler cannot find header files.
QtWS25 Last Chance

QtCreator/Compiler cannot find header files.

Scheduled Pinned Locked Moved Installation and Deployment
17 Posts 4 Posters 19.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    paie
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      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 :-)

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • P Offline
        P Offline
        paie
        wrote on last edited by
        #3

        Thanks for the advice, but how do I get QtCreator to find the include path again? That's most important to me right now, because I can't even build without it.

        1 Reply Last reply
        0
        • P Offline
          P Offline
          paie
          wrote on last edited by
          #4

          When I hover the mouse over the header declarations, like ...

          #include <QtCore>

          ...the QtCreator gives me a mouseover message that says,

          No such file or directory.

          How can I fix this?

          1 Reply Last reply
          0
          • L Offline
            L Offline
            loladiro
            wrote on last edited by
            #5

            Are you using the right qmake in Qt Creator? When you hover your mouse over an entry in Settings -> Qt4, it should tell you where it expects the headers to be (QT_INSTALL_HEADERS).

            1 Reply Last reply
            0
            • P Offline
              P Offline
              paie
              wrote on last edited by
              #6

              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.exe

              When 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.

              1 Reply Last reply
              0
              • L Offline
                L Offline
                loladiro
                wrote on last edited by
                #7

                In the projects tab, you can select which version of Qt to use. Make sure it's "Qt 4.7.3 for Desktop – MSVC2008 (Qt SDK)"

                1 Reply Last reply
                0
                • P Offline
                  P Offline
                  paie
                  wrote on last edited by
                  #8

                  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 file

                  There seems to be one "could not find qmake configuration file" for each source file.

                  1 Reply Last reply
                  0
                  • L Offline
                    L Offline
                    loladiro
                    wrote on last edited by
                    #9

                    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?

                    1 Reply Last reply
                    0
                    • P Offline
                      P Offline
                      paie
                      wrote on last edited by
                      #10

                      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

                      1 Reply Last reply
                      0
                      • P Offline
                        P Offline
                        paie
                        wrote on last edited by
                        #11

                        Right now, QtCreator is crippled as an IDE. Can't find the headers, and the hover hints over the Qt types are gone.

                        And re-install did not change anything.

                        1 Reply Last reply
                        0
                        • P Offline
                          P Offline
                          paie
                          wrote on last edited by
                          #12

                          [quote author="loladiro" date="1313322380"]In the projects tab, you can select which version of Qt to use. Make sure it's "Qt 4.7.3 for Desktop – MSVC2008 (Qt SDK)"[/quote]

                          Yes, it says ...

                          Qt 4.7.3 for Desktop - MSVC2008 (QtSDK)

                          1 Reply Last reply
                          0
                          • M Offline
                            M Offline
                            mlong
                            wrote on last edited by
                            #13

                            Does it do this for all projects? (I.e., if you create a new project are you still seeing the same behavior?)

                            Software Engineer
                            My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

                            1 Reply Last reply
                            0
                            • P Offline
                              P Offline
                              paie
                              wrote on last edited by
                              #14

                              Yes, same behavior, even with the demo examples.

                              1 Reply Last reply
                              0
                              • P Offline
                                P Offline
                                paie
                                wrote on last edited by
                                #15

                                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.

                                1 Reply Last reply
                                0
                                • P Offline
                                  P Offline
                                  paie
                                  wrote on last edited by
                                  #16

                                  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.

                                  1 Reply Last reply
                                  0
                                  • P Offline
                                    P Offline
                                    paie
                                    wrote on last edited by
                                    #17

                                    This may be a bug.

                                    https://bugreports.qt.nokia.com/browse/QTCREATORBUG-5599?focusedCommentId=161302#comment-161302

                                    1 Reply Last reply
                                    0

                                    • Login

                                    • Login or register to search.
                                    • First post
                                      Last post
                                    0
                                    • Categories
                                    • Recent
                                    • Tags
                                    • Popular
                                    • Users
                                    • Groups
                                    • Search
                                    • Get Qt Extensions
                                    • Unsolved