Provide MinGW-specific instructions for building applications

We had instructions for building wxWidgets with MinGW but not for
building the applications using wxWidgets, so add them too now in the
hope that it will be helpful to people who struggle to find the options
to use for building -- or at the very least to the people who have to
answer the questions about this, as they could now just point to these
instructions.
This commit is contained in:
Vadim Zeitlin 2023-11-04 15:08:06 +01:00
parent 9bae94022c
commit ae91254d3e
2 changed files with 37 additions and 10 deletions

View file

@ -414,6 +414,12 @@ The full list of the build settings follows:
Building Applications Using wxWidgets {#msw_build_apps}
=====================================
Note: If you want to use CMake for building your project, please see
@ref overview_cmake.
Using Microsoft Visual C++ IDE {#msw_build_apps_msvc}
------------------------------
If you use MSVS for building your project, simply add
`wxwidgets.props` property sheet to (all) your project(s) using wxWidgets
by using "View|Property Manager" menu item to open the property manager
@ -425,10 +431,8 @@ If you've created a new empty project (i.e. chose "Empty Project" in the
you need to change "Linker|System|SubSystem" in the project properties to
"Windows", from the default "Console". You don't need to do anything else.
If you want to use CMake for building your project, please see
@ref overview_cmake.
Otherwise follow the instructions below for "manual" setup of your project.
Using Other Compilers or Command Line {#msw_build_apps_other}
-------------------------------------
We suppose that wxWidgets sources are under the directory `$WXWIN` (notice that
different tool chains refer to environment variables such as WXWIN in
@ -436,13 +440,14 @@ different ways, e.g. MSVC users should use `$``(WXWIN)` instead of just
`$WXWIN`). And we will use `<wx-lib-dir>` as a shortcut for the subdirectory of
`$WXWIN\lib` which is composed from several parts separated by underscore:
first, a compiler-specific prefix (e.g. "vc" for MSVC, "gcc" for g++ or the
value of `COMPILER_PREFIX` if you set it explicitly), then optional "x64" if
building in 64 bits and finally either "lib" or "dll" depending on whether
static or dynamic wx libraries are being used.
value of `COMPILER_PREFIX` if you set it explicitly), then "x64" if building in
64 bits using MSVC (but not any other compilers) and finally either "lib" or
"dll" depending on whether static or dynamic wx libraries are being used.
For example, WXWIN could be "c:\wxWidgets\3.4.5" and `<wx-lib-dir>` could be
`c:\wxWidgets\3.4.5\lib\vc_x64_lib` for 64-bit static libraries built with
MSVC.
MSVC but for shared libraries built with gcc it would be
`c:\wxWidgets\3.4.5\lib\gcc_dll` instead.
Here is what you need to do:
@ -472,6 +477,18 @@ need to:
(all wxWidgets applications use the base library).
For example, to compile your program with gcc using debug wxWidgets DLLs
you would need to use the following options for the compiler (and `windres`
resource compiler):
-I$WXWIN/include -I$WXWIN/lib/gcc_dll/mswud -D__WXMSW__ -DWXUSINGDLL
and
-L$WXWIN/lib/gcc_dll
for the linker.
Finally, please notice that the makefiles and project files provided with
wxWidgets samples show which flags should be used when building applications
using wxWidgets and always work, so in case of a problem, e.g. if the