Exit code 0xC0000135 at startup when I declare a QChart
-
Hello everyone,
I'm encountering some problems with my app, as I want to implement a Qt Chart in the main window. The app works fine until I declare
chart = new QChart();
in my code. When this code is present, the app compile but finishes instantly with this error code : "Process finished with exit code -1073741515 (0xC0000135)".
Here are some parts of my CMake file (I'm working on CLion) :
set(CMAKE_CXX_STANDARD 17) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) set(CMAKE_PREFIX_PATH "C:/Qt/6.4.2/mingw_64/lib/cmake") find_package(Qt6 COMPONENTS Core Gui Widgets Charts REQUIRED) add_executable(Kite main.cpp) target_link_libraries(Kite Qt::Core Qt::Gui Qt::Widgets Qt::Charts )
I double checked with Qt Maintenance Tool that QtCharts is installed for Qt 6.4.2 (the only Qt version that I have installed), and tried to uninstall/reinstall it.
Does someone know what's wrong with my setup ?Thanks in advance.
-
Hello everyone,
I'm encountering some problems with my app, as I want to implement a Qt Chart in the main window. The app works fine until I declare
chart = new QChart();
in my code. When this code is present, the app compile but finishes instantly with this error code : "Process finished with exit code -1073741515 (0xC0000135)".
Here are some parts of my CMake file (I'm working on CLion) :
set(CMAKE_CXX_STANDARD 17) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) set(CMAKE_PREFIX_PATH "C:/Qt/6.4.2/mingw_64/lib/cmake") find_package(Qt6 COMPONENTS Core Gui Widgets Charts REQUIRED) add_executable(Kite main.cpp) target_link_libraries(Kite Qt::Core Qt::Gui Qt::Widgets Qt::Charts )
I double checked with Qt Maintenance Tool that QtCharts is installed for Qt 6.4.2 (the only Qt version that I have installed), and tried to uninstall/reinstall it.
Does someone know what's wrong with my setup ?Thanks in advance.
Hi and welcome to devnet,
Do you have that issue within Qt Creator ?
-
@SGaist I dit not try with Qt Creator as I don't have that IDE installed and would prefer to stick with CLion.
Since you are working with CLion, what configuration did you have to do to run your Qt application ?
-
Since you are working with CLion, what configuration did you have to do to run your Qt application ?
-
@SGaist I created a Qt Widgets executable project, set the Qt Cmake prefix path, selected Qt version 6, and added Qt Charts in the CMake file, that's all
0xC0000135 looks like you're missing a required library - I would guess the QtCharts dll is not in the PATH / CLion does not add the required path.
-
0xC0000135 looks like you're missing a required library - I would guess the QtCharts dll is not in the PATH / CLion does not add the required path.
@Christian-Ehrlicher I'm wondering : aren't the dlls managed by CMake ? I checked the PATH in my configuration variables of CLion, but there is none, and basic apps (using Core, GUI or Widgets dlls) still work.
In CMakeLists.txt, I added a line to copy Qt6Charts.dll into my application folder, at the same location that Qt6Core.dll, Qt6Gui.dll and Qt6Widgets.dll are located. As it copied Qt6Charts.dll as planned, is it still a possibility that the dll is missing ? Am I misunderstanding something with CMake ? I'm new to it.
cmake_minimum_required(VERSION 3.24) project(Kite) set(CMAKE_CXX_STANDARD 17) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) set(CMAKE_PREFIX_PATH "C:/Qt/6.4.2/mingw_64/lib/cmake") find_package(Qt6 COMPONENTS Core Gui Widgets Charts REQUIRED) add_executable(Kite main.cpp) target_link_libraries(Kite Qt::Core Qt::Gui Qt::Widgets Qt::Charts ) if (WIN32) set(DEBUG_SUFFIX) if (MSVC AND CMAKE_BUILD_TYPE MATCHES "Debug") set(DEBUG_SUFFIX "d") endif () set(QT_INSTALL_PATH "${CMAKE_PREFIX_PATH}") if (NOT EXISTS "${QT_INSTALL_PATH}/bin") set(QT_INSTALL_PATH "${QT_INSTALL_PATH}/..") if (NOT EXISTS "${QT_INSTALL_PATH}/bin") set(QT_INSTALL_PATH "${QT_INSTALL_PATH}/..") endif () endif () if (EXISTS "${QT_INSTALL_PATH}/plugins/platforms/qwindows${DEBUG_SUFFIX}.dll") add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:${PROJECT_NAME}>/plugins/platforms/") add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "${QT_INSTALL_PATH}/plugins/platforms/qwindows${DEBUG_SUFFIX}.dll" "$<TARGET_FILE_DIR:${PROJECT_NAME}>/plugins/platforms/") endif () foreach (QT_LIB Core Gui Widgets Charts) add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "${QT_INSTALL_PATH}/bin/Qt6${QT_LIB}${DEBUG_SUFFIX}.dll" "$<TARGET_FILE_DIR:${PROJECT_NAME}>") endforeach (QT_LIB) endif ()
-
@Christian-Ehrlicher I'm wondering : aren't the dlls managed by CMake ? I checked the PATH in my configuration variables of CLion, but there is none, and basic apps (using Core, GUI or Widgets dlls) still work.
In CMakeLists.txt, I added a line to copy Qt6Charts.dll into my application folder, at the same location that Qt6Core.dll, Qt6Gui.dll and Qt6Widgets.dll are located. As it copied Qt6Charts.dll as planned, is it still a possibility that the dll is missing ? Am I misunderstanding something with CMake ? I'm new to it.
cmake_minimum_required(VERSION 3.24) project(Kite) set(CMAKE_CXX_STANDARD 17) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) set(CMAKE_PREFIX_PATH "C:/Qt/6.4.2/mingw_64/lib/cmake") find_package(Qt6 COMPONENTS Core Gui Widgets Charts REQUIRED) add_executable(Kite main.cpp) target_link_libraries(Kite Qt::Core Qt::Gui Qt::Widgets Qt::Charts ) if (WIN32) set(DEBUG_SUFFIX) if (MSVC AND CMAKE_BUILD_TYPE MATCHES "Debug") set(DEBUG_SUFFIX "d") endif () set(QT_INSTALL_PATH "${CMAKE_PREFIX_PATH}") if (NOT EXISTS "${QT_INSTALL_PATH}/bin") set(QT_INSTALL_PATH "${QT_INSTALL_PATH}/..") if (NOT EXISTS "${QT_INSTALL_PATH}/bin") set(QT_INSTALL_PATH "${QT_INSTALL_PATH}/..") endif () endif () if (EXISTS "${QT_INSTALL_PATH}/plugins/platforms/qwindows${DEBUG_SUFFIX}.dll") add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:${PROJECT_NAME}>/plugins/platforms/") add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "${QT_INSTALL_PATH}/plugins/platforms/qwindows${DEBUG_SUFFIX}.dll" "$<TARGET_FILE_DIR:${PROJECT_NAME}>/plugins/platforms/") endif () foreach (QT_LIB Core Gui Widgets Charts) add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "${QT_INSTALL_PATH}/bin/Qt6${QT_LIB}${DEBUG_SUFFIX}.dll" "$<TARGET_FILE_DIR:${PROJECT_NAME}>") endforeach (QT_LIB) endif ()
@Evoxz said in Exit code 0xC0000135 at startup when I declare a QChart:
I'm wondering : aren't the dlls managed by CMake
No, how should cmake configure your PATH env var? CMake is a build system, not a deubgger or anything else.
-