The third line of the batch file needs to be adjusted so that it points to you widgets library build/msw directory. Example: I unzipped wxWidgets 2.8.10 into
Code: Select all
c:\dev\wx\wxWidgets-2.8.10
Code: Select all
pushd c:\dev\wx\wxWidgets-2.8.10\build\msw
myWxMake.bat
Code: Select all
@echo off
SETLOCAL
pushd C:\dev\wx\wxWidgets-2.8.10\build\msw
cls
echo.
echo -----------------------------------------------------------------------------------
echo wxWidgets Win32/MinGW Helper build script
echo Author: John A. Mason
echo Date: 04/24/2009
echo Release: For anyone to use/copy/manipulate/learn. Hope it helps.
echo -----------------------------------------------------------------------------------
echo.
echo.
echo This script will ask a series of questions to figure out which build you wish to
echo construct. There are many ways, depending on your needs, to build the wxWidgets
echo library.
echo.
echo The defaults have been setup so that you can build the standard build of wxWidgets.
echo Leaving every question blank and just pressing enter will fill in the
echo standard [default] options.
echo.
echo.
echo Let's begin.
echo.
echo -----------------------------------------------------------------------------------
pause
cls
echo.
echo The developers of wxWidgets did a great thing starting with version 2.5
echo in reducing the footprint of the requirements for a wxWidgets application
echo by splitting the giant library into smaller library files. However, this has
echo led to some developers having trouble figuring out which library files they
echo must link to. This script can still build the giant monolithic library if you
echo wish. However, the new default is to build the multilib version (of many,
echo smaller, individual library files).
echo.
echo Would you like to build the libraries as Monolithic library (y/n)? [no]
set /p myMONOLITHIC=
cls
echo.
echo Depending on the needs of your application and the platform requirements,
echo you may wish to build this library as a unicode library. It does require to use
echo of the wxT() macro or _T() macro when defining any and all string literals in
echo all of your application code, however.
echo.
echo Would you like build Unicode libraries (y/n)? [yes]
set /p myUNICODE=
cls
echo.
echo This script can help you build both the static and shared libraries of wxWidgets,
echo or it can be told to only build the shared or only the static.
echo.
echo Leaving the next two prompts at the default is recommended unless you are building
echo a special build that requires you to build the shared libraries separately from
echo the static. E.g. using RUNTIME_LIBS=static cannot be used when building the shared
echo libraries. In that case, you would first build the shared libraries without
echo RUNTIME_LIBS=static. Then you would build the static libraries with the option added.
echo.
echo Would you like to build static libraries (y/n)? [yes]
set /p mySTATIC=
echo Would you like to build shared libraries (y/n)? [yes]
set /p mySHARED=
cls
echo.
echo The vendor name determines the appended name on shared dll files. If you are company
echo ABC, you might want your dll files to be wxbase28u_core_abc.dll to identify that
echo your company provided them as part of your application. Since this is considered a
echo custom build, the default is to add custom to all dll files.
echo.
echo What vendor name for your custom dll files? [custom]
set /p myVENDOR=
cls
echo.
echo All object files are stored in a directory under build\msw, depending on build settings,
echo compiler name, and the CFG setting. Examples of directory names:
echo.
echo build\msw\bcc_msw SHARED=0
echo build\msw\bcc_mswdll SHARED=1
echo build\msw\bcc_mswunivd SHARED=0, WXUNIV=1, BUILD=debug
echo build\msw\vc_mswunivd ditto, with Visual C++
echo.
echo Libraries and DLLs are stored in a directory structure similar, along with the setup.h
echo that matches the build configuration. Examples:
echo with name that contains other settings:
echo.
echo lib\bcc_msw
echo lib\bcc_lib\msw\wx\setup.h
echo lib\bcc_dll
echo lib\bcc_dll\msw\wx\setup.h
echo lib\bcc_lib
echo lib\bcc_lib\mswunivd\wx\setup.h
echo lib\vc_lib
echo lib\vc_lib\mswunivd\wx\setup.h
echo.
pause
cls
echo If you set CFG to something, the value is appended to directory names. Thus, if you set CFG you
echo will need to change your linker command to reflect the changed directory names. E.g.
echo for CFG=MyBuild, you'll have object files in
echo.
echo build\msw\bcc_mswMyBuild
echo build\msw\bcc_mswdllMyBuild
echo etc.
echo.
echo and libraries in
echo.
echo lib\bcc_libMyBuild
echo lib\bcc_dllMyBuild
echo etc.
echo.
echo The purpose of this is to allow for multiple builds with multiple setups that don't conflict.
echo So if you want to build both the monolithic AND the multilib version, set CFG to something
echo different for each build or else the latter build will overwrite the first build.
echo.
echo Would you like to set the CFG of this build? [(empty)]
set /p myCUSTOM=
cls
echo.
echo Reading the INSTALL-MSW.txt file will provide other options that can be used for building.
echo Examples include:
echo.
echo MSLU=1
echo RUNTIME_LIBS=static
echo WXUNIV=1
echo etc.
echo * NOTE: Be sure to read the INSTALL-MSW.txt file for important information. For instance,
echo adding RUNTIME_LIBS=static along side of the SHARED=1 will cause issues!
echo.
echo Would you like to set any other options for this build? [(empty)]
set /p myOTHER=
cls
if "%myMONOLITHIC%" == "" set myMONOLITHIC=no
if "%myUNICODE%" == "" set myUNICODE=yes
if "%mySTATIC%" == "" set mySTATIC=yes
if "%mySHARED%" == "" set mySHARED=yes
if "%myVENDOR%" == "" set myVENDOR=custom
if "%myCUSTOM%" == "" set myCUSTOM=
if "%myOTHER%" == "" set myOTHER=
echo.
echo -----------------------------------------------------------------------------------
echo.
echo Configuration complete:
echo.
echo Build Monolithic: %myMONOLITHIC%
echo Build Unicode: %myUNICODE%
echo Build Static libs: %mySTATIC%
echo Build Shared libs: %mySHARED%
echo Vendor Label: %myVENDOR%
echo Custom Build dir: %myCUSTOM%
echo Other Build options: %myOTHER%
echo.
echo -----------------------------------------------------------------------------------
echo.
echo Please confirm:
echo.
echo Is this correct? (y/n) [y]
set /p myConfirm=
if "%myConfirm%" == "" set myConfirm=yes
if "%myConfirm%" == "n" GOTO END
if "%myConfirm%" == "0" GOTO END
if "%myConfirm%" == "no" GOTO END
cls
echo.
echo -----------------------------------------------------------------------------------
echo.
echo Beginning Build Process...
echo.
echo.
if "%myMONOLITHIC%" == "n" GOTO SKIPMONO
if "%myMONOLITHIC%" == "0" GOTO SKIPMONO
if "%myMONOLITHIC%" == "no" GOTO SKIPMONO
if "%myUNICODE%" == "n" GOTO SKIPUNICODEMONO
if "%myUNICODE%" == "0" GOTO SKIPUNICODEMONO
if "%myUNICODE%" == "no" GOTO SKIPUNICODEMONO
if "%mySTATIC%" == "n" GOTO SKIPSTATICA
if "%mySTATIC%" == "0" GOTO SKIPSTATICA
if "%mySTATIC%" == "no" GOTO SKIPSTATICA
echo.
echo -----------------------------------------------------------------------------------
echo.
echo Building: MONOLITHIC UNICODE STATIC
echo.
echo -----------------------------------------------------------------------------------
echo.
mingw32-make -f makefile.gcc %myOTHER% SHARED=0 BUILD=debug UNICODE=1 MONOLITHIC=1 CFG="%myCUSTOM%" VENDOR="%myVENDOR%" clean
mingw32-make -f makefile.gcc %myOTHER% SHARED=0 BUILD=debug UNICODE=1 MONOLITHIC=1 CFG="%myCUSTOM%" VENDOR="%myVENDOR%"
mingw32-make -f makefile.gcc %myOTHER% SHARED=0 BUILD=release UNICODE=1 MONOLITHIC=1 CFG="%myCUSTOM%" VENDOR="%myVENDOR%" clean
mingw32-make -f makefile.gcc %myOTHER% SHARED=0 BUILD=release UNICODE=1 MONOLITHIC=1 CFG="%myCUSTOM%" VENDOR="%myVENDOR%"
:SKIPSTATICA
if "%mySHARED%" == "n" GOTO END
if "%mySHARED%" == "0" GOTO END
if "%mySHARED%" == "no" GOTO END
echo.
echo -----------------------------------------------------------------------------------
echo.
echo Building: MONOLITHIC UNICODE SHARED
echo.
echo -----------------------------------------------------------------------------------
echo.
mingw32-make -f makefile.gcc %myOTHER% SHARED=1 BUILD=debug UNICODE=1 MONOLITHIC=1 CFG="%myCUSTOM%" VENDOR="%myVENDOR%" clean
mingw32-make -f makefile.gcc %myOTHER% SHARED=1 BUILD=debug UNICODE=1 MONOLITHIC=1 CFG="%myCUSTOM%" VENDOR="%myVENDOR%"
mingw32-make -f makefile.gcc %myOTHER% SHARED=1 BUILD=release UNICODE=1 MONOLITHIC=1 CFG="%myCUSTOM%" VENDOR="%myVENDOR%" clean
mingw32-make -f makefile.gcc %myOTHER% SHARED=1 BUILD=release UNICODE=1 MONOLITHIC=1 CFG="%myCUSTOM%" VENDOR="%myVENDOR%"
GOTO END
:SKIPUNICODEMONO
if "%mySTATIC%" == "n" GOTO SKIPSTATICB
if "%mySTATIC%" == "0" GOTO SKIPSTATICB
if "%mySTATIC%" == "no" GOTO SKIPSTATICB
echo.
echo -----------------------------------------------------------------------------------
echo.
echo Building: MONOLITHIC STATIC
echo.
echo -----------------------------------------------------------------------------------
echo.
mingw32-make -f makefile.gcc %myOTHER% SHARED=0 BUILD=debug UNICODE=0 MONOLITHIC=1 CFG="%myCUSTOM%" VENDOR="%myVENDOR%" clean
mingw32-make -f makefile.gcc %myOTHER% SHARED=0 BUILD=debug UNICODE=0 MONOLITHIC=1 CFG="%myCUSTOM%" VENDOR="%myVENDOR%"
mingw32-make -f makefile.gcc %myOTHER% SHARED=0 BUILD=release UNICODE=0 MONOLITHIC=1 CFG="%myCUSTOM%" VENDOR="%myVENDOR%" clean
mingw32-make -f makefile.gcc %myOTHER% SHARED=0 BUILD=release UNICODE=0 MONOLITHIC=1 CFG="%myCUSTOM%" VENDOR="%myVENDOR%"
:SKIPSTATICB
if "%mySHARED%" == "n" GOTO END
if "%mySHARED%" == "0" GOTO END
if "%mySHARED%" == "no" GOTO END
echo.
echo -----------------------------------------------------------------------------------
echo.
echo Building: MONOLITHIC SHARED
echo.
echo -----------------------------------------------------------------------------------
echo.
mingw32-make -f makefile.gcc %myOTHER% SHARED=1 BUILD=debug UNICODE=0 MONOLITHIC=1 CFG="%myCUSTOM%" VENDOR="%myVENDOR%" clean
mingw32-make -f makefile.gcc %myOTHER% SHARED=1 BUILD=debug UNICODE=0 MONOLITHIC=1 CFG="%myCUSTOM%" VENDOR="%myVENDOR%"
mingw32-make -f makefile.gcc %myOTHER% SHARED=1 BUILD=release UNICODE=0 MONOLITHIC=1 CFG="%myCUSTOM%" VENDOR="%myVENDOR%" clean
mingw32-make -f makefile.gcc %myOTHER% SHARED=1 BUILD=release UNICODE=0 MONOLITHIC=1 CFG="%myCUSTOM%" VENDOR="%myVENDOR%"
GOTO END
:SKIPMONO
if "%myUNICODE%" == "n" GOTO SKIPUNICODE
if "%myUNICODE%" == "0" GOTO SKIPUNICODE
if "%myUNICODE%" == "no" GOTO SKIPUNICODE
if "%mySTATIC%" == "n" GOTO SKIPSTATICC
if "%mySTATIC%" == "0" GOTO SKIPSTATICC
if "%mySTATIC%" == "no" GOTO SKIPSTATICC
echo.
echo -----------------------------------------------------------------------------------
echo.
echo Building: MULTILIB UNICODE STATIC
echo.
echo -----------------------------------------------------------------------------------
echo.
mingw32-make -f makefile.gcc %myOTHER% SHARED=0 BUILD=debug UNICODE=1 MONOLITHIC=0 CFG="%myCUSTOM%" VENDOR="%myVENDOR%" clean
mingw32-make -f makefile.gcc %myOTHER% SHARED=0 BUILD=debug UNICODE=1 MONOLITHIC=0 CFG="%myCUSTOM%" VENDOR="%myVENDOR%"
mingw32-make -f makefile.gcc %myOTHER% SHARED=0 BUILD=release UNICODE=1 MONOLITHIC=0 CFG="%myCUSTOM%" VENDOR="%myVENDOR%" clean
mingw32-make -f makefile.gcc %myOTHER% SHARED=0 BUILD=release UNICODE=1 MONOLITHIC=0 CFG="%myCUSTOM%" VENDOR="%myVENDOR%"
:SKIPSTATICC
if "%mySHARED%" == "n" GOTO END
if "%mySHARED%" == "0" GOTO END
if "%mySHARED%" == "no" GOTO END
echo.
echo -----------------------------------------------------------------------------------
echo.
echo Building: MULTILIB UNICODE SHARED
echo.
echo -----------------------------------------------------------------------------------
echo.
mingw32-make -f makefile.gcc %myOTHER% SHARED=1 BUILD=debug UNICODE=1 MONOLITHIC=0 CFG="%myCUSTOM%" VENDOR="%myVENDOR%" clean
mingw32-make -f makefile.gcc %myOTHER% SHARED=1 BUILD=debug UNICODE=1 MONOLITHIC=0 CFG="%myCUSTOM%" VENDOR="%myVENDOR%"
mingw32-make -f makefile.gcc %myOTHER% SHARED=1 BUILD=release UNICODE=1 MONOLITHIC=0 CFG="%myCUSTOM%" VENDOR="%myVENDOR%" clean
mingw32-make -f makefile.gcc %myOTHER% SHARED=1 BUILD=release UNICODE=1 MONOLITHIC=0 CFG="%myCUSTOM%" VENDOR="%myVENDOR%"
GOTO END
:SKIPUNICODE
if "%mySTATIC%" == "n" GOTO SKIPSTATICD
if "%mySTATIC%" == "0" GOTO SKIPSTATICD
if "%mySTATIC%" == "no" GOTO SKIPSTATICD
echo.
echo -----------------------------------------------------------------------------------
echo.
echo Building: MULTILIB STATIC
echo.
echo -----------------------------------------------------------------------------------
echo.
mingw32-make -f makefile.gcc %myOTHER% SHARED=0 BUILD=debug UNICODE=0 MONOLITHIC=0 CFG="%myCUSTOM%" VENDOR="%myVENDOR%" clean
mingw32-make -f makefile.gcc %myOTHER% SHARED=0 BUILD=debug UNICODE=0 MONOLITHIC=0 CFG="%myCUSTOM%" VENDOR="%myVENDOR%"
mingw32-make -f makefile.gcc %myOTHER% SHARED=0 BUILD=release UNICODE=0 MONOLITHIC=0 CFG="%myCUSTOM%" VENDOR="%myVENDOR%" clean
mingw32-make -f makefile.gcc %myOTHER% SHARED=0 BUILD=release UNICODE=0 MONOLITHIC=0 CFG="%myCUSTOM%" VENDOR="%myVENDOR%"
:SKIPSTATICD
if "%mySHARED%" == "n" GOTO END
if "%mySHARED%" == "0" GOTO END
if "%mySHARED%" == "no" GOTO END
echo.
echo -----------------------------------------------------------------------------------
echo.
echo Building: MULTILIB SHARED
echo.
echo -----------------------------------------------------------------------------------
echo.
mingw32-make -f makefile.gcc %myOTHER% SHARED=1 BUILD=debug UNICODE=0 MONOLITHIC=0 CFG="%myCUSTOM%" VENDOR="%myVENDOR%" clean
mingw32-make -f makefile.gcc %myOTHER% SHARED=1 BUILD=debug UNICODE=0 MONOLITHIC=0 CFG="%myCUSTOM%" VENDOR="%myVENDOR%"
mingw32-make -f makefile.gcc %myOTHER% SHARED=1 BUILD=release UNICODE=0 MONOLITHIC=0 CFG="%myCUSTOM%" VENDOR="%myVENDOR%" clean
mingw32-make -f makefile.gcc %myOTHER% SHARED=1 BUILD=release UNICODE=0 MONOLITHIC=0 CFG="%myCUSTOM%" VENDOR="%myVENDOR%"
echo -----------------------------------------------------------------------------------
echo.
echo Building: COMPLETE
echo.
echo Hope this helped you.
echo.
echo -----------------------------------------------------------------------------------
echo.
:END
set myUNICODE=
set myMONOLITHIC=
set myVENDOR=
set myCUSTOM=
set myOTHER=
set myConfirm=
popd
ENDLOCAL
And FYI, windows users/developers aren't dumb. It's just that some people don't understand how to build a library when they start out, and let's face it. Lots of people have windows, use windows, and so they try to learn on windows. The point of this script is to help people like that. Hey, back in the Windows 3.1 days I was one of those people! Sure, I was in the 5th grade, but I was still trying to teach myself how to program C/C++ on windows! So go for it you windows noobies! And good luck.