cLion + Qt5 - exit code -1073741515 (0xC0000135)

对着背影说爱祢 提交于 2020-06-13 11:12:12

问题


I'm trying to run simple test using QT5 and cLion but I run in to the exit code wall... Here is my envi :
cLion 2017.2
minGw 5.0 < according to 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();
}

Execution > Process finished with exit code -1073741515 (0xC0000135)

Can any1 help me out with this error please? Regards Dariusz


回答1:


Have a look at this post: Setting up Qt for CLion

Basically, you have to add C:\QT\5.x\mingwxx_32\bin to your PATH environment variable.



来源:https://stackoverflow.com/questions/44739411/clion-qt5-exit-code-1073741515-0xc0000135

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!