Compiling and configuring wxWidgets has never been easy. But don’t worry finally we can always get it done. Vamos!
1. Download wxWidgets
In the download page of wxWidgets, you can find the latest/most-stable version.
2. Compile wxWidgets
It would always be convenient to set the directory (sth like “C:\xc\wxWidgets-2.8.10\”) of the wxWidgets as one of the Environment Variables (how). Suppose we have set it as “WXWIDGETS”.
Open the directory of your downloaded package and browse to $(WXWIDGETS)\build\msw. Open wx.dsw. Then do the following before you build them:
- Set the compile type as Unicode Debug.
- In menu Build, select Batch Build. Then select all the files and build them.
It should be noted that there might be errors during the build (one possibility is that multithreading breaks the dependencies between files). And currently the best way to do it is to rebuild it…
3. Configure on first-time use
After compilation, open your VS and go to Tools – Options – Projects and Solutions – VC++ Directions,
- In Include files, add $(WXWIDGETS)\include and $(WXWIDGETS)\include\msvc.
- In Library files, add $(WXWIDGETS)\vc_lib
Then get down to your first program. You can find the hello-world program from here.
Create a new Win32 Console Application (how?!). In the coming dialog, select Windows application as the Application Type and Empty project as the Additional options.
Create a .cpp file, maybe using the hello-world sample.
In menu Project, select Properties. Normally we start our project in the following setting (not the unique solution): in the Linker–Input–Additional Dependencies, add these: wxbase28ud.lib wxmsw28ud_core.lib winmm.lib comctl32.lib rpcrt4.lib wsock32.lib oleacc.lib.
Hopefully you can build your first program now. If there are still errors, don’t worry because that’s perfectly normal. Ping me via My Email Address. Maybe I still remember how to tackle them.