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 [dpaste.com] . 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)
↧