I installed vcpkg and then ran the command vcpkg install wxwidgets
. This has successfully installed wxwidgets. To test it, I have the following files:
wxsample.cpp
class MyApp : public wxApp
{
public:
virtual bool OnInit();
};
class MyFrame : public wxFrame
{
//Contents
};
wxIMPLEMENT_APP(MyApp);
//rest of the code
CMakeLists.txt
cmake_minimum_required(VERSION 3.27.2)
project(Hello)
include(C:/vcpkg/scripts/buildsystems/vcpkg.cmake)
add_executable(Hello wxsample.cpp)
find_package(wxwidgets REQUIRED COMPONENTS core base)
include(${wxWidgets_USE_FILE})
target_include_directories(Hello PRIVATE ${wxWidgets_INCLUDE_DIRS})
target_link_libraries(Hello PRIVATE ${wxWidgets_LIBRARIES} )
The cpp file compiles fine but I get the following error:
MSVCRT.lib(exe_main.obj) : error LNK2019: unresolved external symbol main referenced in function “int __cdecl __scrt_common_main_seh(void)” (?__scrt_common_main_seh@@YAHXZ)
I am fairly new to vcpkg ecosystem so any ideas what I might be missing?