WindowsMinGW without MSYS

team bbl


MinGW can also be used from Microsoft's command line (cmd.exe or command.com). You can control your build style by using flags to the compiler. The MinGW makefile is in the build\msw directory. From there, invoke MinGW using a command such as the following, which demonstrates how to toggle all of the major build options:

 mingw32-make -f makefile.gcc UNICODE=1 SHARED=0 BUILD=release \     MONOLITHIC=0 

(The backslash is only there to denote that the command should be typed all on one line.)

The compiled library files are placed into the lib directory under your wxWidgets directory. Two directories are created: gcc_dll and gcc_lib, for the shared and static builds, respectively.

To remove the object files and libraries, append the target clean to the same command line. However, be aware that this won't clean up the copy of setup.h that is placed under the gcc_lib and gcc_dll directories, so if you make any edits to include\wx\msw\setup.h, delete the gcc_lib or gcc_dll directories yourself before recompiling.

Note

If you are using MinGW without MSYS but have MSYS installed, the MSYS directories should not be in your path; otherwise, the wrong version of make could be used. If the wrong version of make is used, you will get cryptic error messages for processes that are otherwise correct. This conflict occurs because MinGW and MSYS share common file names for non-identical files that are not interchangeable.


Compiling a wxWidgets Sample Program

If you change into one of these sample program directories, you will see a makefile for MinGW called makefile.gcc. The sample programs are built using the same command and switches as the library itself and are designed to look within the wxWidgets tree for the include and library files in their default locations. Be sure that you specify flags for a configuration of the library that has been built, or the sample will fail to link. That is, if you have only built a Unicode static release version of wxWidgets, use the same build options for the sample. For example:

 cd c:\wx\samples\minimal mingw32-make -f makefile.gcc UNICODE=1 SHARED=0 BUILD=release \     MONOLITHIC=0 minimal.exe 

(The backslash is only there to denote that the command should be typed all on one line.)

To clean the sample, append clean to the make command.

    team bbl



    Cross-Platform GUI Programming with wxWidgets
    Cross-Platform GUI Programming with wxWidgets
    ISBN: 0131473816
    EAN: 2147483647
    Year: 2005
    Pages: 262

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net