csteifel
csteifel

Reputation: 2934

I can't even get the wxWidgets samples to compile using a

So I have been trying to get even just the damn samples for wxWidgets to compile with Mingw and I did like so mingw32-make -f makefile.gcc and I get the following error.

I do not have MSYS installed, and I have the latest version of Mingw

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
In file included from .\..\..\include/wx/defs.h:26:0,
                 from .\..\..\include/wx/wxprec.h:13,
                 from minimal.cpp:21:
.\..\..\include/wx/platform.h:256:22: fatal error: wx/setup.h: No such file or d
irectory
compilation terminated.
mingw32-make: *** [gcc_mswud\minimal_minimal.o] Error 1'

Any advice would be greatly appreciated

Also how exactly should I be compiling my own projects involving wxWidgets, what do I need to link against wxWidgets in mingw?

Upvotes: 2

Views: 2956

Answers (1)

RobertoP
RobertoP

Reputation: 637

wx/setup.h is a file that is created during the compilation process; this file will be different for each different build type (Unicode, ANSI, Debug or Release, etc.). Most likely you compiled wxWidgets for one build type and are trying to compile the samples for a different build type.

As for the include / linker paths I have found the settings below to the bare minimum required to use wxWidgets in your own projects on Windows:

Include Paths

  • $(WXWIN)\include
  • $(WXWIN)\lib\vc_lib\mswud (u = Unicode and d=debug, this changes depending on what build type you want)

Pre-processor Definitions

  • WIN32
  • _DEBUG (only if you want to build with debugging info)
  • _WINDOWS

Character Set

  • "Use Unicode Character Set" (very important for Unicode builds; otherwise you will get compiler errors)

Additional Library Directories

  • $(WXWIN)\lib\vc_lib

Additional Dependencies

  • winmm.lib
  • comctl32.lib
  • rpcrt4.lib
  • wsock32.lib
  • odbc32.lib
  • wxmsw28ud_core.lib
  • wxbase28ud.lib
  • wxexpatd.lib
  • wxjpegd.lib
  • wxpngd.lib
  • wxregexud.lib
  • wxtiffd.lib
  • wxzlibd.lib
  • wxmsw28ud_adv.lib
  • wxmsw28ud_aui.lib
  • wxmsw28ud_html.lib

wxWidgets libraries are post-fixed with "u" for Unicode and "d" for debug, you need to choose the libraries that match the build type you want. $(WXWIN) is the directory where you built wxWidgets (wxPack will create this environment variable for you to use).

Upvotes: 1

Related Questions