When I was using wxWidgets to compile a test program on Windows, I got a program with an old visual style that looked like Windows 95.
I found the answer on the wxWidget official website:https://wxwidgets.org/docs/faq/windows/#manifest
Why do controls in my application look odd?
If the controls do not look as expected (very noticeable e.g. with buttons), your application probably does not have an application manifest and so Windows displays the controls using the old (Windows 95-like) “classic” look. wxWidgets provides such a manifest in wx/msw/wx.rc and so your application will be themed automatically so long as you include that file in your own .rc file.
To solve this problem, I can create a new 'res' directory in the program directory, create a 'resource.rc' file in it, and edit it to include the 'wx.rc' file.
#include <windows.h>
#include "wx/msw/wx.rc"
After that, you can write the makefile like this, telling windres where to find wxWidget and compile the resource files into the program.
WXWIDGET_INCLUDE = -ID:\BuildTools\wxWidgets-3.1.2\lib\gcc_dll\mswu -ID:\BuildTools\wxWidgets-3.1.2\include
$(TARGET): main.o res/resource.o
$(CC) -o $(TARGET) main.o res/resource.o $(LDFLAGS) $(LIBS)
//Other rules
...
res/resource.o: res/resource.rc
windres $(WXWIDGET_INCLUDE) res/resource.rc -o res/resource.o
Or just compile it manually
windres -ID:\BuildTools\wxWidgets-3.1.2\lib\gcc_dll\mswu -ID:\BuildTools\wxWidgets-3.1.2\include res/resource.rc -o res/resource.o
g++ -o main.exe main.o res/resource.o -I...
After that, the interface takes on a modern style.
In addition, an installation and usage issue obtained from the official website
Why do I get errors about setup.h not being found?
When you build the wxWidgets library, setup.h is copied from include/wx/msw/setup.h to e.g. lib/vc_lib/mswud/wx/setup.h (the path depends on the configuration you’re building). So you need to add lib/vc_lib/mswud to your include path if building using the static Unicode Debug library, or lib/vc_lib/mswu if building the static Unicode Release library.