Configure MinGW + Codeblocks + wxWidgets on 64-bit Windows 7

Source: Internet
Author: User
Tags wxwidgets

Install and configure MinGW + Codeblocks + wxWidgets on Windows 7 64-bit host as follows:
1. Download The mingw-get-inst-20111118: http://sourceforge.net/projects/mingw /;
2. Double-click mingw-get-inst-20111118.exe. You can select the desired component by default;
3. Add MinGW environment variable: Right-click computer, select Properties, select Advanced System settings, click environment variable, select PATH, and click Edit. C: add \ MinGW \ bin to the environment variable, click OK, and enter gcc in cmd. If a fatal error is returned and no input file is entered, the installation is successful.
4. The following example shows a C ++ program code. Use vs2008 to create a console program:
 
# Include "stdafx. h"
# Include <iostream>
Using namespace std;
Int _ tmain (int argc, _ TCHAR * argv [])
{
Cout <"Hello! "<Endl;
Return 0;
}
The directory where the hello. cpp file is stored is F: \ test \ hello
Enter the following commands in sequence:
F: \ test \ hello> g ++-c hello. cpp // generate the hello. o file
F: \ test \ hello> g ++-o hello. cpp // generate the hello.exe File
F: \ test \ hello> hello.exe // output Hello!
5. Download codeblocks-10.05mingw-setup: http://www.codeblocks.org/downloads/26;
6, double-click codeblocks-10.05mingw-setup, installation directory is best do not have Chinese or space, components according to their needs to choose, after the completion of the desktop will generate a CodeBlocks icon;
7. Double-click the CodeBlocks icon on the desktop, and you will be prompted to select a default Compiler. Select gnu gcc Compiler, select Yes in File associations, and select associate Code :: blocks with C/C ++ file types;
8. Create a simple console application: File à New à Project... À Projects, select the Console application, click Go à Next à, select C ++, and click Next à Project title: projiect1; Folder to create project in: F: \ test \ codeblocks; project filename: project1.white; Resulting filename: F: \ test \ codeblocks \ project1 \ project1.white; click Next à default, and click Finish. A main is generated by default. cpp file, compile and run it.
9. Download The wxMSW-Setup-2.9.3: http://www.wxwidgets.org/downloads/#latest_stable;
10、double-click wxmsw-setup-2.9.3.exe, click Next continuously, and click Finish;
11. Open the command line interface, enter the c: \ wxWidgets-2.9.3 \ build \ msw directory, execute
Mingw32-make-f makefile. gcc clean
Mingw32-make-f makefile. gcc MONOLITHIC = 0 SHARED = 1 UNICODE = 1 BUILD = release
Mingw32-make-f makefile. gcc MONOLITHIC = 0 SHARED = 1 UNICODE = 1 BUILD = debug
Command to compile the Release and Debug libraries respectively;
12. Open CodeBlocks, File à New à Project... À Projects, select wxWidgets project, click Go, And Next à select wxWidgets2.9x (SVN Version) à Next à Project title: project2; Folder to create project in: F: \ test \ codeblocks; à Next, enter à Next at will, select wxSmith in Preferred GUI Builder, select Dialog Based à Next in Application Type, in wxWidgets 'location C: \ wxWidgets-2.9.3 à Next, in wxWidgets Library Settings, select Use wxWidgets DLL and Enable unicode. The default value is "à Next à Finish". Compile and run the program.
 

From fengbingchun's column

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.