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] Qt5.2.1 header compilation errors
QtWS25 Last Chance

[Solved] Qt5.2.1 header compilation errors

Scheduled Pinned Locked Moved Installation and Deployment
2 Posts 1 Posters 1.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.
  • R Offline
    R Offline
    rcapote
    wrote on last edited by
    #1

    After finally figuring out how to link Qt5 using CMake...I am now running into issues with the Qt header files. You can see the full extent of the errors "here on dpaste":http://dpaste.com/hold/1639740/ . I am using MinGW32/MSYS/g++ to compile the test application.

    Some of the errors are
    @
    /C/Qt/Qt5.2.1/5.2.1/mingw48_32/include/QtCore/qgenericatomic.h:95: warning: gnu_inline' attribute directive ignored ... /C/Qt/Qt5.2.1/5.2.1/mingw48_32/include/QtCore/qstring.h:664: error: expected unqualified-id before '&' token /C/Qt/Qt5.2.1/5.2.1/mingw48_32/include/QtCore/qstring.h:664: error: expected ,' or `...' before '&' token
    ...
    @

    Source code:

    @
    #include <QApplication>

    int main(int argc, char **argv) {
    QApplication app(argc, argv);

    return app.exec();
    }
    @

    and CMakeLists

    @
    cmake_minimum_required(VERSION 2.8.11)

    project(helloqt)

    set(CMAKE_PREFIX_PATH "C:\Qt\Qt5.2.1\5.2.1\mingw48_32;C:\Program Files\Microsoft SDKs\Windows\v7.0")

    find_package(Qt5Widgets)

    add_executable(helloqt helloqt.cpp)

    target_link_libraries(helloqt Qt5::Widgets)
    @

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rcapote
      wrote on last edited by
      #2

      Okay, I was able to solve this problem. If I remember correctly, I had to use the correct MinGW-builds toolchain. 32bit-dwarf-posix

      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