0

I'm trying to build the hello world application as show on the official website but when i run the application I get the error Process finished with exit code -1073741515 (0xC0000135)

I followed the instructions from here,so after downloading the source from Github i write the following CMakeLists.txt file:

CMakeLists.txt

cmake_minimum_required(VERSION 3.22)
project(myproj)
set(CMAKE_CXX_STANDARD 17)
add_subdirectory(libs/wxWidgets-3.1.6)
add_executable(myproj main.cpp)
target_link_libraries(myproj wx::net wx::core wx::base)

The project got compiled and linked corectly but every time it runs i got the error indicating that some dll file is missing. So am I missing some configurations to add to CMakeLists or I have to do something else?

dfref56
  • 1
  • 1
  • HRESULT [0xC0000135](https://james.darpinian.com/decoder/?q=0xC0000135). – Eljay May 16 '22 at 12:53
  • 2
    ***So am I missing some configurations to add to CMakeLists*** While you could use some post build task functionality in CMake to copy the dlls to the same location as the executable this really is not an issue with CMake. Instead as a user you need to understand how your OS searches for dlls and take some step to help your OS: [https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order](https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order) – drescherjm May 16 '22 at 13:16
  • 1
    Related to copying the dlls: [https://stackoverflow.com/questions/10671916/how-to-copy-dll-files-into-the-same-folder-as-the-executable-using-cmake](https://stackoverflow.com/questions/10671916/how-to-copy-dll-files-into-the-same-folder-as-the-executable-using-cmake) – drescherjm May 16 '22 at 13:19
  • @dfref56, why not build static linking configuration and forget about DLL altogether? – Igor May 16 '22 at 13:27
  • @Igor, I think static linking can significantly affect compilation time – dfref56 May 16 '22 at 18:04
  • @dfref56, can you elaborate? Build time depends on the hardware, not how you configure build... – Igor May 16 '22 at 18:54

0 Answers0