Skip to content


WxWidgets

Poniewaz zawsze mam spore problemy z instalacja i kompilacja wxWidgets, ota jak to zrobic:

set PATH=C:\MinGW\bin;%PATH%
cd %WXWIN%\build\msw
mingw32-make -f makefile.gcc clean
mingw32-make -f makefile.gcc USE_XRC=1 MONOLITHIC=1 SHARED=1 UNICODE=1 BUILD=debug USE_OPENGL=1
mingw32-make -f makefile.gcc USE_XRC=1 MONOLITHIC=1 SHARED=1 UNICODE=1 BUILD=release USE_OPENGL=1

analogicznie przechodzimy do katalogu z przykladami i taka sama(!) komenda robimy build…
Krotkie omowienie co jest czym:
BUILD

BUILD controls whether a debug version (BUILD=debug) or release version (BUILD=release) of wxWidgets itself is built. In the vast majority of cases you will only need a release version of wxWidgets, since you won’t be interesting in debugging wxWidgets itself. You can still create debug builds of your own programs that link to a release build of wxWidgets.
A debug build of wxWidgets creates libraries with a “d” suffix — for example, “libwxmsw28d.a”/”wxmsw28d_gcc_custom.dll”.
A debug build of wxWidgets creates the folder “mswd” or “mswud” in the wxWidgets library output folder.
A release build of wxWidgets creates libraries without the “d” suffix — for example, “libwxmsw28.a”/”wxmsw28_gcc_custom.dll”.
A release build of wxWidgets creates the folder “msw” or “mswu” in the wxWidgets library output folder.

SHARED

SHARED controls whether a DLL (SHARED=1) or static (SHARED=0) version of wxWidgets is built. With a DLL build, compile times are faster and the executable size is smaller. The total size of a single executable plus the wxWidgets DLL is greater, but multiple executables can use the same DLL.
A DLL build of wxWidgets creates import libraries (such as libwxmsw28.a) and DLLs (such as wxmsw28_gcc_custom.dll). You must include the DLL when you distribute your program.
A static build of wxWidgets creates static libraries only (such as libwxmsw28.a), and you do not need to distribute a wxWidgets DLL.

MONOLITHIC

MONOLITHIC controls whether a single library (MONOLITHIC=1) or multiple component libraries (MONOLITHIC=0) are built. With a monolithic build, project setup and development are much easier, and you only have one DLL to distribute if you’re using a DLL build. With a non-monolithic (multilib) build, several different libraries are built and you can avoid linking with the entire wxWidgets codebase for programs that don’t need it. You do have to ensure that you choose the correct component libraries.
A monolithic build of wxWidgets creates a single wxWidgets import library (such as libwxmsw28.a) and a single DLL (such as wxmsw28_gcc_custom.dll).
A multilib build of wxWidgets creates multiple import libraries (libwx28_base.a, etc.) and multiple DLLs.
Additional static libraries are always created with any wxWidgets build (libwxexpat.a, libwxjpeg.a, etc.). These libraries do not normally need to be used with DLL builds of wxWidgets, but they are required when using static builds.

UNICODE

UNICODE controls whether wxWidgets and your program use wide-character strings with Unicode support. Most programs for Windows 2000 and later should do so. Earlier versions of Windows don’t have the necessary Unicode support. You should always use wxWidget’s _(“string”) and _T(“string”) macros to ensure that your hardcoded strings are the correct type.
A Unicode (UNICODE=1) build of wxWidgets creates libraries with a “u” suffix — for example, “libwxmsw28u.a”/”wxmsw28u_gcc_custom.dll”.
A Unicode build of wxWidgets creates the folder “mswu” or “mswud” in the wxWidgets library output folder.
An ANSI (UNICODE=0) build of wxWidgets creates libraries without the “u” suffix — for example, “libwxmsw28.a”/”wxmsw28_gcc_custom.dll”.
An ANSI build of wxWidgets creates the folder “msw” or “mswd” in the wxWidgets library output folder.

I get errors like “wx/setup.h: No such file or directory”

You’re missing an important compiler search path in your build options. Make sure you choose the correct wxWidgets build configuration when running the wxWidgets project wizard. If re-running the wizard isn’t an option, then open your project’s build options and add “$(#wx.lib)\gcc_dll\mswu” (assuming a monolithic Unicode DLL build) to the compiler search paths.

I get errors like “cannot find -lwxmsw28u”

You have an incorrect link library in your build options. Make sure you choose the correct wxWidgets build configuration when running the wxWidgets project wizard. If re-running the wizard isn’t an option, determine which version of the library is built and adjust the library name in your build options accordingly.

Posted in TechBlog.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.