Author Topic: wxWidgets 2.4.2  (Read 6391 times)

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
wxWidgets 2.4.2
« on: October 24, 2004, 11:13:34 am »
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?
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
wxWidgets 2.4.2
« Reply #1 on: October 24, 2004, 05:45:58 pm »
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.
Be patient!
This bug will be fixed soon...

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
wxWidgets 2.4.2
« Reply #2 on: October 24, 2004, 06:37:48 pm »
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
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
wxWidgets 2.4.2
« Reply #3 on: November 03, 2004, 09:27:29 pm »
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?  :?:
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
wxWidgets 2.4.2
« Reply #4 on: November 04, 2004, 06:23:51 pm »
Quote from: mispunt
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:

Code: [Select]

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.
Be patient!
This bug will be fixed soon...

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Some clarifications.
« Reply #5 on: February 13, 2005, 06:00:41 am »
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) :

Code: [Select]
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! :)

LoneGuard

  • Guest
wxWidgets 2.4.2
« Reply #6 on: May 14, 2005, 01:29:04 am »
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:

Code: [Select]
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

Code: [Select]
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?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
wxWidgets 2.4.2
« Reply #7 on: May 14, 2005, 09:25:41 am »
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.
Be patient!
This bug will be fixed soon...