Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
I am using a cmake script and In the script I am using fetchContent module to build the wxwidgets library in Ubuntu 22.04 and windows 11.My build options are Release + static + monolithic + unicode. In windows I am using vscode + MSVC and in the ubuntu I am using vscode+gcc. I am successfully able to build the wxwidgets library and Link it with the project. But in windows 11 the library is built successfully but when it is linking with the project . It is producing a linker error.
fatal error LNK1104: cannot open file 'wxbase32u.lib'.
My build option is monolithic, why is it asking for wxbase32u.lib. My cmake Script is:
Adding MSVC-specific include folder means that MSVC-specific setup.h will be #included by the main setup.h file. This MSVC-specific setup.h automatically links wxWidgets libraries; however, it has no idea you are using monolithic build (as wxMONOLITHIC is not set by CMake and thus was not #defined as 1) and thus tries to link against multilib libraries. I suggest removing the quoted block from your CMakefile. That setup.h exists only for autolink convenience, and is not needed with CMake (and the code is also incorrectly guarded with WIN32 instead of MSVC).
Adding MSVC-specific include folder means that MSVC-specific setup.h will be #included by the main setup.h file. This MSVC-specific setup.h automatically links wxWidgets libraries; however, it has no idea you are using monolithic build (as wxMONOLITHIC is not set by CMake and thus was not #defined as 1) and thus tries to link against multilib libraries. I suggest removing the quoted block from your CMakefile. That setup.h exists only for autolink convenience, and is not needed with CMake (and the code is also incorrectly guarded with WIN32 instead of MSVC).