Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [SOLVED] Qt Creator and CMake on Windows
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Qt Creator and CMake on Windows

Scheduled Pinned Locked Moved Qt Creator and other tools
4 Posts 2 Posters 5.2k 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.
  • A Offline
    A Offline
    aaichert
    wrote on last edited by
    #1

    I am trying to move away from Microsoft Visual Studio on Widnows.

    I have installed the binaries Qt 5.3.2 for Windows 32-bit (MinGW 4.8.2, OpenGL) directly from http://qt-project.org/downloads and I have a simple CMakeLists.txt

    @[...]
    find_package(Qt5Widgets)
    set(CMAKE_AUTOMOC ON)
    add_executable(Test test.cpp )
    qt5_use_modules(Test Widgets)
    [...]
    @
    It works when I use CMake through the Visual Studio Generator and it also works on Linux.

    QtCreator:

    • I open the CMake Project using QtCreator
    • I use CMakeGui to set the variable Qt5Widgets_DIR = "C:\Qt\Qt5.3.2\5.3\mingw482_32\lib\cmake/Qt5Widgets"
    • I set Core and GUI accordingly
    • Then QtCreator successfully configures and generates its makefiles.

    My source code compiles but I get linkage errors
    @undefined reference to `_imp___ZN12QApplicationC1ERiPPci'
    @

    and a couple similar ones.

    It would be very helpful if somebody could point out what I am doing wrong in this simplistic set up.

    Trouble is, I can't even see the compiler call in the "4 Compile Output" tab, which is annoying to begin with. NOW: How can I check EXACTLY which libraries are being linked. The makefiles are really hard to read...

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

      Hi and welcome to devnet,

      Did you check the "Qt Creator's manual":http://qt-project.org/doc/qt-5/cmake-manual.html for qmake

      Hope it helps

      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
      • A Offline
        A Offline
        aaichert
        wrote on last edited by
        #3

        Really, nobody any suggestions?

        I guess I'm just not gonna use QtCreator, if a simple linker problem is unsolvable.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          aaichert
          wrote on last edited by
          #4

          SOOOO I got it.

          I had
          CMAKE_PREFIX_PATH
          set to
          C:\Qt\Qt5.3.1\5.3\msvc2013_64_opengl

          I simply deleted that environment variable and now it works.

          I don't think this is intended behavior. It should be possible to set all variables in CMake and override whatever is in CMAKE_PREFIX_PATH.

          My problem that I don't see what exactly the makefile is doing. SO far I do not like QtCreator.

          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