WindowsMicrosoft Visual C Command Line

team bbl


WindowsMicrosoft Visual C++ Command Line

Microsoft's C++ compiler is part of any Visual C++ installation (or can be downloaded free from Microsoft) and can be used from the command line. The Microsoft compiler makefile is in the build\msw directory. From there, invoke the Microsoft compiler using a command such as the following ones, which demonstrate how to toggle all of the major configuration options:

 nmake -f makefile.vc UNICODE=0 SHARED=0 BUILD=release MONOLITHIC=0 nmake -f makefile.vc UNICODE=0 SHARED=0 BUILD=debug MONOLITHIC=0 

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

If you need ODBC or OpenGL functionality, set wxUSE_ODBC or wxUSE_GLCANVAS to 1 in include\wx\msw\setup.h before compiling, and also pass USE_ODBC=1 or USE_OPENGL=1 on the nmake command line.

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 vc_lib and vc_dll directories, so if you make any edits to include\wx\msw\setup.h, delete the vc_lib or vc_dll directories yourself before recompiling.

Compiling a wxWidgets Sample Program

If you change into one of the sample program directories, you will see a makefile for Microsoft's compiler called makefile.vc. The sample programs are built using the same command and switches as the library itself, and they 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 samples\widgets nmake -f makefile.vc UNICODE=1 SHARED=0 BUILD=release MONOLITHIC=0 vc_mswd\widgets.exe 

As with the library makefile, you can clean a sample by appending the clean target, for example:

 nmake -f makefile.vc UNICODE=0 SHARED=0 BUILD=debug clean 

    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