Here we take the latest code: blocks 1.0rc2 and wxWidgets 2.6.2 as an example to describe how to set up the code: blocks + wxWidgets environment on the Windows platform and FreeBSD platform, and the methods on other platforms as an example.
-
Windows
-
To code: blocks official website http://www.codeblocks.org download code: blocks + minggw installation package, download and install with the default settings.
Set the environment variable and add C:/program files/codeblocks/bin to the path environment variable. For Windows XP, right-click "my computer" and select "properties" in the pop-up menu. In the displayed dialog box, click the "advanced" tab, click the "environment variables" button below, select "path" in "system variables", and click "edit; add "; C:/program files/codeblocks/bin" at the end of the "variable value" column in the pop-up dialog box (no quotation marks are required). "OK" All dialog boxes are available. We recommend that you restart your computer to make the new environment variables take effect.
Download the wxWidgets installation package from the http://www.wxwidgets.org on the wxWidgets official website, and install it with the default settings.
Open a command line Console (Start Menu-> Program/All Programs-> attachment-> command prompt) and execute the following code for compilation:
- C:
- CD/wxWidgets-2.6.2/build/MSW/
- Mingw32-make-F makefile. GCC build = release clean
- Mingw32-make-F makefile. GCC build = release
This is a long compilation process.
...... (Do other things)
After compilation is complete, open code: blocks and create a wxWidgets project. compile the project to see if it can be run.
If the project is created using wxWidgets DLL, The wxmsw26_gcc_custom.dll file may be missing during running. In this case, one of the following three methods can be selected so that the program can find the DLL:
Copy C:/wxWidgets-2.6.2/lib/gcc_dll/wxmsw26_gcc_custom.dll to C:/Windows/system32 /;
Copy C:/wxWidgets-2.6.2/lib/gcc_dll/wxmsw26_gcc_custom.dll to the folder where the project is located;
Add C:/wxWidgets-2.6.2/lib/gcc_dll/to the path environment variable.
If the project is created using static wxWidgets library, it may be reported that the wxmsw library cannot be found in LD during compilation (build. Select project> build options from the menu, click the "linker" tab in the displayed dialog box, click "wxmsw" in the list, and click "edit, change it to "wxbase26" and click "add". In the displayed dialog box, enter "wxmsw26_core" and click "OK". Then, use the triangle button next to it to promote it to the top; compile the project again. If the program uses other libraries, add them here and pay attention to the order.
-
Under FreeBSD
-
Install code: blocks from ports
Run the following command as root:
- CD/usr/ports/devel/codeblocks/
- Make install clean
The wxgtk2 and wxgtk2-common ports are automatically installed after you run this command. If not, install it on your own.
Returns the identity of a common user. Open code: blocks (you can execute codeblocks in the command line to open it. If it is a CSH shell, you must first execute rehash after installation), create a wxWidgets project and try to compile it, if yes, the installation is successful.
If 'wxgtk2-2.6-config: no such file or directory is reported during compilation, open a term and execute:
- Wxgtk2-2.6-config -- cflags
Do not close this term after execution. Click code: blocks menu project-> build options. In the displayed dialog box, click the "compiler" tab and select the "Other Options" tab, replace 'wxgtk2-2.6-config -- cflags 'with the output in the term. Run the following command in term:
- Wxgtk2-2.6-config -- libs
Click the linker tag in the build Options dialog box in code: blocks. In other Linker Options, replace 'wxgtk2-2.6-config -- libs' with the output in the term.
Recompile the project and you will be able to pass it.