trayres
trayres

Reputation: 532

ld failing to find wxWidgets

I'm trying to make the minimal sample for wxWidgets. I'm getting the following output:

$ mingw32-make -f makefile.gcc
g++ -c -o gcc_mswud\minimal_minimal.o -g -O0 -mthreads  -DHAVE_W32API_H -D__WXMS
W__       -D_UNICODE  -I.\..\..\lib\gcc_lib\mswud -I.\..\..\include  -W -Wall -I
.  -I.\..\..\samples -DNOPCH   -Wno-ctor-dtor-privacy   -MTgcc_mswud\minimal_min
imal.o -MFgcc_mswud\minimal_minimal.o.d -MD -MP minimal.cpp
g++ -o gcc_mswud\minimal.exe gcc_mswud\minimal_sample_rc.o gcc_mswud\minimal_min
imal.o  -g -mthreads -L.\..\..\lib\gcc_lib -Wl,--subsystem,windows -mwindows
-lwxmsw29ud_core  -lwxbase29ud   -lwxtiffd -lwxjpegd -lwxpngd  -lwxzlibd -lwxreg
exud -lwxexpatd    -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -ls
hell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lwini
net
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: cannot fin
d -lwxmsw29ud_core
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: cannot fin
d -lwxbase29ud
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: cannot fin
d -lwxtiffd
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: cannot fin
d -lwxjpegd
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: cannot fin
d -lwxpngd
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: cannot fin
d -lwxzlibd
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: cannot fin
d -lwxregexud
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: cannot fin
d -lwxexpatd
collect2.exe: error: ld returned 1 exit status
makefile.gcc:222: recipe for target 'gcc_mswud\minimal.exe' failed
mingw32-make: *** [gcc_mswud\minimal.exe] Error 1

For some reason I cannot find the wxwidgets libraries; I think I may have set some environment variable up incorrectly or perhaps I should have moved them to /mingw/lib?

Could someone help me track this down or point me in the right direction, I'd really appreciate it.

Thanks!

Upvotes: 1

Views: 1098

Answers (2)

VZ.
VZ.

Reputation: 22688

Did you build wxWidgets libraries as explained in the MinGW section of the documentation? It looks like the linker can't find the libraries because they are simply not there -- which would seem to indicate that you didn't build them. You need to do this first, before building the samples.

Upvotes: 1

Captain Obvlious
Captain Obvlious

Reputation: 20063

You have told gcc to link the wxWidget libraries but haven't told it where to find them.

Just add -Lc:/your_wxwidget_path to the command line options for for the linker and it should link.

Upvotes: 1

Related Questions