简体   繁体   English

cLion + Qt5-退出代码-1073741515(0xC0000135)

[英]cLion + Qt5 - exit code -1073741515 (0xC0000135)

I'm trying to run simple test using QT5 and cLion but I run in to the exit code wall... Here is my envi : 我正在尝试使用QT5和cLion运行简单的测试,但是我遇到了退出代码墙...这是我的envi:
cLion 2017.2 狮子2017.2
minGw 5.0 < according to cLion minGw 5.0 <根据cLion
cMake 3.8.2 c制作3.8.2
Qt 5.9.0 Qt 5.9.0

CMakeList.txt 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 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();
}

Execution > Process finished with exit code -1073741515 (0xC0000135) 执行>流程结束,退出代码为-1073741515(0xC0000135)

Can any1 help me out with this error please? 请问any1可以帮我解决这个错误吗? Regards Dariusz 问候达里乌斯

Have a look at this post: Setting up Qt for CLion 看一下这篇文章: 为CLion设置Qt

Basically, you have to add C:\\QT\\5.x\\mingwxx_32\\bin to your PATH environment variable. 基本上,您必须将C:\\QT\\5.x\\mingwxx_32\\binPATH环境变量中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM