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. [SOLVED] Project compiles in Qt Creator, but not in qmake
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Project compiles in Qt Creator, but not in qmake

Scheduled Pinned Locked Moved Installation and Deployment
qmake
3 Posts 2 Posters 1.3k Views 2 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.
  • C Offline
    C Offline
    Chainsawkitten
    wrote on last edited by Chainsawkitten
    #1

    I've made a simple program to mute other applications using Qt and the Windows API. When I open the .pro file in Qt Creator and compile, it works fine. However, when I run:

    qmake
    mingw32-make
    

    in cmd, it can't find mmdeviceapi.h (part of the Windows API).

    Full log:

    mingw32-make -f Makefile.Release
    mingw32-make[1]: Entering directory `C:/Program Files (x86)/Jenkins/workspace/Mute Exceptions'
    g++ -c -pipe -fno-keep-inline-dllexport -O2 -std=c++0x -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I"." -I"..\..\..\..\Qt\5.4\mingw491_32\include" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtWidgets" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtGui" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtCore" -I"release" -I"." -I"..\..\..\..\Qt\5.4\mingw491_32\mkspecs\win32-g++"  -o release\main.o src\main.cpp
    In file included from src\main.cpp:1:0:
    src\MainWindow.h:9:25: fatal error: mmdeviceapi.h: No such file or directory
    compilation terminated.
    mingw32-make[1]: *** [release/main.o] Error 1
    mingw32-make[1]: Leaving directory `C:/Program Files (x86)/Jenkins/workspace/Mute Exceptions'
    mingw32-make: *** [release] Error 2
    

    I'm on Windows 7, using Qt 5.4 and the MinGW 4.9.1 packages that come with Qt. (Qt 5.4/MinGW 4.9.1 (32bit) OpenGL and Tools/MinGW 4.9.1).

    Not sure what I'm doing wrong since it works in Qt Creator.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on last edited by
      #2

      Hi,

      can you check if in Qt Creator Build Environment there's some special settings?
      And also how qmake is invoked by Qt Creator?

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      1 Reply Last reply
      1
      • C Offline
        C Offline
        Chainsawkitten
        wrote on last edited by Chainsawkitten
        #3

        Thanks. You set me on the right track.

        The problem was that I wasn't actually using the Qt MinGW package. I just thought I was. I was using a four year old version of MinGW I had installed in C:\MinGW since that was earlier in the PATH. Qt Creator seems to automatically add its MinGW to the beginning of the PATH so it was using the correct version of MinGW while I was using the old one.

        So a pretty clear sign that cleaning up my PATH is well overdue. (Also in there, 4 year old GTK.)

        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