0

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

Dariusz
  • 960
  • 13
  • 36
  • `0xC0000135` means that some dll was not found – Vladimir Bershov Jun 24 '17 at 19:08
  • Ended copying all 2gb of dlls in to the folder. Looks like that fixed it lol! Need to figure out how to use cMake to add path to proper dll location... any hints would be great! – Dariusz Jun 25 '17 at 22:11
  • seems like your IDE (cLion) just doesn't know right paths to Qt dlls (or the PATH system variable is incorrect), and here is the answer: https://stackoverflow.com/q/38031603/4149835 – Vladimir Bershov Jun 26 '17 at 15:45

1 Answers1

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.

Scott Smith
  • 3,900
  • 2
  • 31
  • 63
  • I don't know why someone had maybe downvoted this, but yes! Putting the Qt binaries into PATH had allowed me to be able to run it on Windows + Qt5 + CLion + CMake + VS2019 – VPZ Apr 05 '20 at 13:13