'Error with WxWidgets as sub module, missing some dlls

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?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source