我正在尝试使用QT5和cLion进行简单测试但是我跑进了退出代码墙...这是我的环境:
cLion 2017.2
minGw 5.0<根据cLion
cMake 3.8.2
Qt 5.9.0
CMakeList.txt
cmake_minimum_required(VERSION 3.8)
project(testWindotQt)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp )
add_executable(testWindotQt ${SOURCE_FILES})
if (WIN32)
# If you compile on windows replace path to your Qt folder
set(CMAKE_PREFIX_PATH "C:\\Qt\\5.9\\mingw53_32")#\\lib\\cmake")
endif()
find_package(Qt5Core REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Gui REQUIRED)
qt5_use_modules(testWindotQt Core Widgets Gui)
target_link_libraries(testWindotQt Qt5::Widgets Qt5::Core Qt5::Gui)
的main.cpp
#include <iostream>
#include <QtWidgets/QApplication>
#include <QtWidgets/QLabel>
int main(int argc, char *argv[])
{
std::cout << "Hello, World!" << std::endl;
QApplication a(argc, argv);
QLabel *label = new QLabel("HeyYou");
label->show();
return a.exec();
}
执行&gt; 处理完成,退出代码为-1073741515(0xC0000135)
Any1可以帮我解决这个错误吗? 问候 达留