I am trying to install/add wxWidgets to my installation of CodeBlocks, but when I try to run he wxWidgets template, I get the error that the linker could not find -lwxmsw241.
I know it should be in my lib directory, and there is libwxmsw.a but when I rename it, I get a lot of errors/warnings/etc.
My question, which package of wxWidgets should I use to install? just wxMSW-2.4.2.zip?
and whenI've got the rigth package, what is the problem than?
Yes, the template contains a linker option for the wxWidgets 2.4.1 library. Go to project options and, in the "Linker options" tab, change the line that says -lwxmsw241 to -lwxmsw (erase "241").
Then it should work fine :)
Yiannis.
hmm. it still doesn't work :( I think there is something wrong with my installation of wxwidgets. I get a lot of undefined references... any tips?
--edit--
I have download the setup file, and now I see that I have to compile it first :?
So I first trying that.. hope it works
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? :?:
Quote from: mispuntI 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?
If you 've followed the above instructions, you have created a wxWidgets DLL. In the new project wizard you should have selected this (it's the option "Using wxWidgets DLL").
Try adding WXUSINGDLL in "Project Build options->Compiler options->Compiler definitions".
Yiannis.