Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. 'qmake' examples fail for freshly installed Qt-5.7
Forum Updated to NodeBB v4.3 + New Features

'qmake' examples fail for freshly installed Qt-5.7

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 2.0k Views 1 Watching
  • 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.
  • staengS Offline
    staengS Offline
    staeng
    wrote on last edited by
    #1

    Hello experts.

    I installed a fresh Qt-5.7 version and I am trying to setup a basic hello world project using qmake following the Qt qmake tutorial. After I manually create the project file

    //hello.pro
    HEADERS += hello.h
    SOURCES += hello.cpp
    SOURCES += main.cpp
    

    and run 'qmake -o Makefile hello.pro' I get the follow output:
    > qmake -o Makefile hello.pro
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.

    However all necessary files are created (Makefile, Makefile.Debug, Makefile.Release as well as empty debug and release folders). Running make returns

    > make
    mingw32-make -f Makefile.Release
    mingw32-make[1]: Entering directory 'C:/Qt/Qt5.7.0/Examples/Qt-5.7/qmake/tutorial'
    g++ -c -pipe -fno-keep-inline-dllexport -O2 -std=gnu++11 -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I. -I../../../../5.7/mingw53_32/include -I../../../../5.7/mingw53_32/include/QtGui -I../../../../5.7/mingw53_32/include/QtANGLE -I../../../../5.7/mingw53_32/include/QtCore -Irelease -I../../../../5.7/mingw53_32/mkspecs/win32-g++ -o release/hello.o hello.cpp
    In file included from hello.cpp:52:0:
    hello.h:51:23: fatal error: QPushButton: No such file or directory
    compilation terminated.
    Makefile.Release:172: recipe for target 'release/hello.o' failed
    mingw32-make[1]: *** [release/hello.o] Error 1
    mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.7.0/Examples/Qt-5.7/qmake/tutorial'
    Makefile:34: recipe for target 'release' failed
    mingw32-make: *** [release] Error 2

    My own attempts of creating a fresh project have all failed, so help of any kind is greatly appreciated.

    Cheers

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      You are missing QT += widgets in your .pro file.

      The widgets have got their own modules in Qt 5.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • staengS Offline
        staengS Offline
        staeng
        wrote on last edited by staeng
        #3

        Hi, thanks for the hint. I still get the missing path errors, however make now does compile successfully but the program crashes instantly (see screenshot). Some procedure entry point could not be located.. ? This seems like an odd error for a new Qt installation, maybe I should consider reinstalling it?

        Or might I have done something wrong somewhere else? I installed Qt-5.7 for mingw 5.3 (which came with Qt inside the tools directory) and then added the mingw /bin and the Qt /bin paths to my PATH variable. Now I am using vim, make and qmake via a terminal. Is that okay so far?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          It's not odd. You're doing development from command line on Windows. Since you're learning Qt, use Qt Creator, That will save you lots of time and troubles. Windows is not the most command line friendly OS for development.

          If you still want to use the command line for development, then you must add Qt's bin path to the PATH environment variable. Not from the tools folder but from the matching Qt/5.X/mingw_32. DON'T do that system wide, just for the console you're working in.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • staengS Offline
            staengS Offline
            staeng
            wrote on last edited by
            #5

            In fact, I started learning Qt a while ago (Qt4). I just switched to a new machine and thus needed to install Qt and I so chose to get the latest version. If it is at all possible I would like to keep using the command line since I have never had issues with qmake at all (hence my debugging skills are practically zero).

            My PATH variable contains the paths for the Qt binaries and the mingw binaries, respectively.
            C:\Qt\Qt5.7.0\5.7\mingw53_32\bin;
            C:\Qt\Qt5.7.0\Tools\mingw530_32\bin;

            And I reinstalled the whole thing, without effect. Is there anything obvious left to try?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              IIRC, you might have a shortcut in the start menu to open a pre-configured command line for Qt. That might be faster to get you running.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              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