Note: The operation must be performed strictly in the order described in this article.
1. Download and install codeblocks
The installation package used by the pen is codeblocks-10.05mingw-setup.exe, which comes with the mingw tool chain for ease.
Note that the installation path must not contain Chinese characters or spaces. The installation path is: e: \ codeblocks.
After installation, add the bin directory path of mingw to the environment variable path.
For the author's environment, the bin directory of mingw is: e: \ codeblocks \ mingw \ bin
2. Configure codeblocks
The timing for this step is important. After codeblocks is installed, you must immediately perform the configuration operation. Otherwise, Character Set compatibility problems may occur.
A) modify the source file storage encoding, open the setting-> Editor-> other setting page, and set the encoding to Windows-936 by default.
B) modify the encoding format used by the compiler to explain the source file and generate the execution file. Open setting-> compiler and debugger settings, and select "Gun GCC compiler" compiler, then compiler settings-> other options, and enter:
-Finput-charset = GBK-fexec-charset = GBK
3. Download and install wxWidgets
The version I used is wxWidgets-2.8.12.
Note that the installation path must not contain Chinese characters or spaces. The author's installation path is: e: \ wxWidgets-2.8.12
4. Compile wxWidgets (the configuration in step 2 will affect the compilation here)
DOS window, enter E: \ wxWidgets-2.8.12 \ build \ MSW, execute the following command
Mingw32-make-F makefile. GCC build = release shared = 1 monolithic = 1 Unicode = 1 2> err. Log
Mingw32-make-F makefile. GCC build = release shared = 0 monolithic = 1 Unicode = 1 2> err. Log
5. Configure wxWidgets content in codeblocks
Open setting-> compiler and debugger settings-> search directories,
Enter "E: \ wxWidgets-2.8.12 \ include" and "E: \ wxWidgets-2.8.12 \ contrib \ include" in compiler ".
Enter E: \ wxWidgets-2.8.12 \ Lib \ gcc_lib and E: \ wxWidgets-2.8.12 \ Lib \ gcc_dll in linker
Enter E: \ wxWidgets-2.8.12 \ include in resource compiler