A quick overview of the links I posted (I hate following links since they're explained in a lot of detail and I have a short attention span) is as follows:
Build wxWidgets
Assuming you have the latest version of C::B (12.11) and the MinGW that comes with it (4.7.1 I believe) you need to build wxWidgets as follows:
Go to the command prompt and make sure that the MinGW directory is part of the path. Type
mingw32-make -v. You should get an output other than mingw32-make doesn't name a program or something like that. Mine displays:
C:\Documents and Settings\Administrator>mingw32-make -v
GNU Make 3.82.90
Built for i686-pc-mingw32
Copyright (C) 1988-2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. |
Note: I have a different version of MinGW installed though.
As long as you get something along those lines, we can build wxWidgets. Change the working directory to the one that has the main directory of wxWidgets. Mine is
C:\wxWidgets-2.9.4.
This step is pretty simple, but long, as you already found out. I used this command to build my version
mingw32-make -f makefile.gcc MONOLITHIC=1 SHARED=0 UNICODE=1 BUILD=release.
Now, I'll explain in a little bit more detail what each of those do and their counterparts.
Monolithic specifies one large DLL or several small ones. This also determines the necessary libraries that need to be included into wxWidgets when compiling a project (one large library or a few smaller ones). If this is set to 0, monolithic is turned off and you must include each library that you're going to use. This saves space in the long run, but if you're just starting out, it's one more headache to worry yourself with. This also prevents (if shared is turned on) having to include several different DLLs. MONOLITHIC=1 is suggested.
Shared specifies if you're going to be creating a smaller .exe but requiring a DLL (or multiple) of if you're going to generate one large executable that only requires DLLs that are needed to run any other built application (I believe there is one or two required for mingw built programs). SHARED=0 disables the need for DLLs (you're more than welcome to include them anyways, but not needed) but makes your program larger. SHARED=1 requires the DLLs (as stated above) and is recommended (not by me). This will create a smaller .exe
Unicode specifies if you want to enable unicode characters or not. Since Unicode has been accepted as a standard, it's been included in almost every OS in the last 10-15 years. UNICODE=1 enables unicode and is highly recommended. UNICODE=0 disables unicode, I don't recommend it, and requires a little more work when working with special characters.
Build specifies your target application. For all intensive purposes, you only need release. debug allows wxWidgets to enter it's own debugging symbols. You can make two different builds if you really want to use a debugger, but you can set up a debug version of your program to just use the gdb debugging symbols.
Once your wxWidgets is built, it's on to test it.
Creating a wxSmith Project
Obviously you're going to want to open up C::B and create a new project (even though you have one, I suggest making a new one in case any of the flags were changed). Select wxWidgets at the bottom. If you get a welcome screen, skip it. Choose your version (the version of wxWidgets you built (mine was 2.9.4, yours might vary)). Select project title, directory, etc. Enter your information if you want. Select wxSmith and Frame based. Select the directory that wxWidgets is located in (mine was
C:\wxWidgets-2.9.4). Select compiler and uncheck debug or you're going to get an error in the next step. This is where the flags are important.
Use wxWidgets DLL = SHARED. If shared was 1, select this.
wxWidgets is built as a monolithic library = MONOLITHIC. If monolithic was 1, select this.
Enable unicode = UNICODE. If unicode was 1, select this.
Create Empty Project I leave this unselected as it creates your starting frame and a lot of other stuff you don't want to worry about yet.
Create and use precompiled header (PCH) I highly suggest using this as there are a
lot of header files and they're fairly large. Enabling this will take longer to compile on the first time than if it was off, but all sequential builds (that don't modify the headers) will compile quicker than if it was off.
Configure Advanced Options I suggest leaving this off as the default options are fine for a base user.
You're done. Now compile and run it. If you followed the steps I gave you, everything should be fine with the possible exceptions of an error indicating _strdup and strcasecmp haven't been defined. The only workaround that I know of is to disable all C++ flags (C++0x, C++11, etc.) and enable this flag
-std=gnu++0x. You can add this line under the build options of the project under other options of compiler settings.
Let me know how it goes and if you run into any errors, try to copy the build log's initial command to compile (it will be rather long and be filled with a bunch of information). If you're getting errors, paste them too.
If everything works, have fun. ^.^