I am trying to get wxwidgets compilled on my Windows box for while now, but I can't get it working :( does someone knows a pre-compiled package which I could download? :?:
Building wxWidgets on windows, using mingw gcc is really a no-brainer.
Assuming you decompressed wxWidgets in C:\tmp, all you have to do is:
cd c:\tmp\wxWidgets-2.4.2\src\msw
mingw32-make -f makefile.g95 WXMAKINGDLL=1 FINAL=1 UNICODE=0
If you don't want to build wxWidgets as a DLL set WXMAKINGDLL=0.
FINAL=0 means that no debug info should be left inside the generated library. For UNICODE=0, you figure out what it means :wink:
After the build is done, copy C:\tmp\wxWidgets-2.4.2\include\wx\* to C:\MinGW\include\wx\* (assuming a default mingw installation).
Also copy C:\tmp\wxWidgets-2.4.2\lib\*.a to C:\MinGW\lib. Finally copy C:\tmp\wxWidgets-2.4.2\lib\wxmsw242.dll to C:\Windows\System32.
That's it.
For every project you 're building that uses wxWidgets, you just have to link it to libwxmsw242.a
HTH,
Yiannis.
IMPORTANT!
If you get an error when doing the mingw32-make (something about a "process" that could not be started), you could install the MSYS package provided by MINGW:
http://www.mingw.org/download.shtml#hdr2. The file (at the time of this post) is MSYS-1.0.10.exe. It's on the file list.
The current installation will provide you with a shortcut that opens a MSYS window. This is a "virtual *nix" window. From there I could compile the package perfectly.
Here are the "inside msys" instructions
(provided you installed wxwidgets in c:\tmp) :
cd /c/tmp/wxWidgets-2.4.2/src/msw
make -f makefile.g95 WXMAKINGDLL=1 FINAL=1 UNICODE=0
That's it.
Regarding a missing setup.h:
If you get a setup.h missing when you try to compile your wxWidgets project, it's hidden in include/wx/msw. The file should be c:\tmp\wxWidgets-2.4.2\include\wx\msw\setup.h. Copy it into your MINGW include\wx directory. For some reason my make didn't do it.
After that I got no compile problems at all :)
And I got my "Hello,World" running! :)
I followed the steps above and compiled wxWidgets 2.4.2 successfully. I copied include and lib files accordingly. Then I created a new wxWidgets project with the C::B wizzard. I haven't changed anything yet :wink:. When I try to build it, the compiler pass is ok, but the linker reports:
D:\Programme\Programming\MinGW\lib/libmingw32.a(main.o)(.text+0x97):main.c: undefined reference to `WinMain@16'
As there are several info lines telling me that wxWidgets symbols were resolved, like
Info: resolving _wxTheApp by linking to __imp__wxTheApp (auto-import)
I assume that the linker found the wx library. But what is the problem with the WinMain@16 symbol?