Can't compile wxWidgets

Hello,
I'm tying to compile wxWidgets for Windows.
I downloaded wxMSW-2.9.1-Setup.exe and followed this tutorial http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef
At first everything was fine but then I got these errors:


Compiler errors:

Creating library file: ..\..\lib\gcc_dll\libwxmsw29u.a
c:/program files/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.e
xe: <unknown-file>:0: syntax error
Warning: .drectve `-export:T.1003 ' unrecognized
c:/program files/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.e
xe: <unknown-file>:0: syntax error
Warning: .drectve `-export:T.1228 ' unrecognized
c:/program files/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.e
xe: <unknown-file>:0: syntax error
Warning: .drectve `-export:T.1579 ' unrecognized
c:/program files/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.e
xe: <unknown-file>:0: syntax error
Warning: .drectve `-export:T.1989 ' unrecognized
c:/program files/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.e
xe: <unknown-file>:0: syntax error
Warning: .drectve `-export:T.2309 ' unrecognized
c:/program files/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.e
xe: <unknown-file>:0: syntax error
Warning: .drectve `-export:T.1561 ' unrecognized
c:/program files/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.e
xe: <unknown-file>:0: syntax error
Warning: .drectve `-export:T.1672 ' unrecognized
c:/program files/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.e
xe: <unknown-file>:0: syntax error
Warning: .drectve `-export:T.1712 ' unrecognized
c:/program files/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.e
xe: <unknown-file>:0: syntax error
Warning: .drectve `-export:T.1857 ' unrecognized
c:/program files/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.e
xe: <unknown-file>:0: syntax error
Warning: .drectve `-export:T.1590 ' unrecognized
c:/program files/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.e
xe: <unknown-file>:0: syntax error
Warning: .drectve `-export:T.1685 ' unrecognized
c:/program files/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.e
xe: <unknown-file>:0: syntax error
[...]


Linker errors:

..\..\lib\gcc_dll\libwxscintilla.a(wxscintilla_Editor.o):Editor.cxx:(.text+0x6d
e): undefined reference to `_imp__wxTheAssertHandler'
..\..\lib\gcc_dll\libwxscintilla.a(wxscintilla_Editor.o):Editor.cxx:(.text+0x70
1): undefined reference to `_imp___Z10wxOnAssertPKciS0_S0_S0_'
..\..\lib\gcc_dll\libwxscintilla.a(wxscintilla_Editor.o):Editor.cxx:(.text+0x71
a): undefined reference to `_imp___Z7wxQsortPvjjPFiPKvS1_S1_ES1_'
..\..\lib\gcc_dll\libwxscintilla.a(wxscintilla_Editor.o):Editor.cxx:(.text$_ZN8
xVectorI14SelectionRangeE2atEj[wxVector<SelectionRange>::at(unsigned int)]+0xf)
undefined reference to `_imp__wxTheAssertHandler'
..\..\lib\gcc_dll\libwxscintilla.a(wxscintilla_Editor.o):Editor.cxx:(.text$_ZN8
xVectorI14SelectionRangeE2atEj[wxVector<SelectionRange>::at(unsigned int)]+0x46
: undefined reference to `_imp___Z10wxOnAssertPKciS0_S0_S0_'
..\..\lib\gcc_dll\libwxscintilla.a(wxscintilla_Selection.o):Selection.cxx:(.tex
+0x76a): undefined reference to `_imp___Z10wxOnAssertPKciS0_S0_S0_'
..\..\lib\gcc_dll\libwxscintilla.a(wxscintilla_Selection.o):Selection.cxx:(.tex
+0x7e9): undefined reference to `_imp__wxTheAssertHandler'
..\..\lib\gcc_dll\libwxscintilla.a(wxscintilla_Selection.o):Selection.cxx:(.tex
+0x823): undefined reference to `_imp___Z10wxOnAssertPKciS0_S0_S0_'
..\..\lib\gcc_dll\libwxscintilla.a(wxscintilla_Selection.o):Selection.cxx:(.tex
+0x937): undefined reference to `_imp__wxTheAssertHandler'
..\..\lib\gcc_dll\libwxscintilla.a(wxscintilla_Selection.o):Selection.cxx:(.tex
+0x96e): undefined reference to `_imp___Z10wxOnAssertPKciS0_S0_S0_'



[...]


..\..\lib\gcc_dll\libwxscintilla.a(wxscintilla_Selection.o):Selection.cxx:(.text
$_ZN9wxPrivate21wxVectorMemOpsGenericI14SelectionRangeE15MemmoveBackwardEPS1_S3_
j[wxPrivate::wxVectorMemOpsGeneric<SelectionRange>::MemmoveBackward(SelectionRan
ge*, SelectionRange*, unsigned int)]+0x14): undefined reference to `_imp__wxTheA
ssertHandler'
..\..\lib\gcc_dll\libwxscintilla.a(wxscintilla_Selection.o):Selection.cxx:(.text
$_ZN9wxPrivate21wxVectorMemOpsGenericI14SelectionRangeE15MemmoveBackwardEPS1_S3_
j[wxPrivate::wxVectorMemOpsGeneric<SelectionRange>::MemmoveBackward(SelectionRan
ge*, SelectionRange*, unsigned int)]+0x77): undefined reference to `_imp___Z10wx
OnAssertPKciS0_S0_S0_'
..\..\lib\gcc_dll\libwxscintilla.a(wxscintilla_Selection.o):Selection.cxx:(.text
$_ZNK8wxVectorI14SelectionRangeE2atEj[wxVector<SelectionRange>::at(unsigned int)
const]+0xf): undefined reference to `_imp__wxTheAssertHandler'
..\..\lib\gcc_dll\libwxscintilla.a(wxscintilla_Selection.o):Selection.cxx:(.text
$_ZNK8wxVectorI14SelectionRangeE2atEj[wxVector<SelectionRange>::at(unsigned int)
const]+0x46): undefined reference to `_imp___Z10wxOnAssertPKciS0_S0_S0_'
..\..\lib\gcc_dll\libwxscintilla.a(wxscintilla_Selection.o):Selection.cxx:(.text
$_ZN8wxVectorI14SelectionRangeE5eraseEPS0_S2_[wxVector<SelectionRange>::erase(Se
lectionRange*, SelectionRange*)]+0x19): undefined reference to `_imp__wxTheAsser
tHandler'
..\..\lib\gcc_dll\libwxscintilla.a(wxscintilla_Selection.o):Selection.cxx:(.text
$_ZN8wxVectorI14SelectionRangeE5eraseEPS0_S2_[wxVector<SelectionRange>::erase(Se
lectionRange*, SelectionRange*)]+0x63): undefined reference to `_imp___Z10wxOnAs
sertPKciS0_S0_S0_'
..\..\lib\gcc_dll\libwxscintilla.a(wxscintilla_Selection.o):Selection.cxx:(.text
$_ZN8wxVectorI14SelectionRangeE5eraseEPS0_S2_[wxVector<SelectionRange>::erase(Se
lectionRange*, SelectionRange*)]+0xd6): undefined reference to `_imp__wxTheAsser
tHandler'
..\..\lib\gcc_dll\libwxscintilla.a(wxscintilla_Selection.o):Selection.cxx:(.text
$_ZN8wxVectorI14SelectionRangeE5eraseEPS0_S2_[wxVector<SelectionRange>::erase(Se
lectionRange*, SelectionRange*)]+0x13b): undefined reference to `_imp___Z10wxOnA
ssertPKciS0_S0_S0_'
collect2: ld returned 1 exit status
mingw32-make: *** [..\..\lib\gcc_dll\wxmsw291u_gcc_custom.dll] Error 1



What could go wrong? And the most important thing is that I had to wait for an hour only to find out that this doesn't compile!

Thanks for help!
Last edited on
Here's what I did and it works fine with Code::Blocks WYSIWYG.

1. I go to wxwidgets download page and downloaded
http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.8.11.zip

2. I read the INSTALL-MSW.txt that comes with the package. It says
Use the makefile.gcc files for compiling wxWidgets and samples,
e.g. to compile a debugging version of wxWidgets:
  > cd c:\wx\build\msw
  > mingw32-make -f makefile.gcc BUILD=debug
  > cd c:\wx\samples\minimal
  > mingw32-make -f makefile.gcc BUILD=debug
  (See below for more options.)

3. I compiled with this options.
mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1

4. Cheers!!

Notes:
1. I use Mingw compiler that comes with code::blocks.
2. It takes about 40 minutes to compile on my very old Pentium 4 1.7ghz
3. Disable your anti-virus when compiling.

If luck does not come with you, I'll upload it for you if you want to. Though it might take some time to upload 45mb
Unknown error in line ) ? This sound like you have a very old version of ld.exe, please use latest version of GCC compiler for windows and mingw-runtime for windows from http://tdragon.net/recentgcc/ or use visual studio 2010.
@blackcoder41: I'll try to do everything as you said. Maybe I got these errors because I was trying to compile version 2.9 (which isn't stable)

@modoran: No, my gcc-mingw isn't very old (4.4.0)
Topic archived. No new replies allowed.