2

i am struggling to set up Qt5 for CLion. Somehow, I did this for VS before but failed to do this in CLion. Building and Including Qt headers are fine and CLion find qt symbols and auto-completes them but when i am using an Qt object Clion giving me this error:

C:\Users\binhb.CLion2016.1\system\cmake\generated\LBMTopoOptimization-ae159e87\ae159e87\Debug\LBMTopoOptimization.exe Process finished with exit code -1073741515 (0xC0000135)

My CMake file looks like this:

cmake_minimum_required(VERSION 3.5)
project(LBMTopoOptimization)

# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)

# set prefix path for Qt5
set (CMAKE_PREFIX_PATH "C:\\QT\\5.7\\mingw53_32\\")

# Find QT Libraries
find_package( Qt5Core REQUIRED )
find_package( Qt5Widgets REQUIRED )
find_package( Qt5Gui REQUIRED )

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11")

set(SOURCE_FILES main.cpp)
add_executable(LBMTopoOptimization ${SOURCE_FILES})

# Use the modules from Qt 5.
target_link_libraries(LBMTopoOptimization Qt5::Widgets Qt5::Core Qt5::Gui)

The error would already occur by using for example a QString:

#include <QWidget>

int main(int argc, char** argv ){
    QString name = "this is a string";
return 0;
}
  • System specification:
  • Windows 10
  • Clion 1.3
  • Qt 5.7
  • CMake 3.6 rc3
  • mingw-gcc 4.9.3

I looking forward for any hints.

1 Answer 1

4

Try to add Qt library's installation directory (select specific Qt version and build system \bin sub-subdirectory) to PATH environment variable .

I have been struggling with similar problem. I have had installed Qt library (version 5.6 and 5.7) in C:\Qt\ directory. In my project I use version 5.6. Build system is MinGW.

After I have added C:\Qt\5.6\mingw49_32\bin, everything works fine.

The reason for this behaviour is quite simple. During the build, build system 'knows' where to search for libraries, but when app is being executed, Windows system searches for required libraries in application's directory and directories specified by PATH variable.

If it fails, application exits with -1073741515 (0xC0000135) error.

2
  • Thanks that is the answer to the problem. I actually figured it out long time ago but forget to post the solution here. It was the erroneous system path that triggered the error message. Aug 31, 2016 at 15:38
  • 1
    @Bui Thanh Binh and bercik can you both post ur answers maybe? I'm having the same issue and no luck so far. Getting the -1073741515 (0xC0000135) error now. I added the QT C:\Qt\5.9\mingw53_32\bin to my windows environment Path - no luck. I added set(CMAKE_PREFIX_PATH "C:\\QT\\5.9\\mingw53_32\\bin") still no luck.
    – Dariusz
    Jun 26, 2017 at 21:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.