Search code examples
c++command-linewxwidgets

Compiling wxWidgets from command line


I want to compile the wxWidgets v3.0.0 from visual C++ 2010 command line, and I want to use /MT option which responsible for the C Runtime Library. and the following is what I have done:

nmake /MT -f makefile.vc BUILD=release MONOLITHIC=0 SHARED=0 UNICODE=1

But there is an error in the previous command nmake fatal error u1065 invalid option 'M, because this /MT. Note that /MT, /MD, etc are options in the compiler.

Now, how can I write the correct command that can control in use C runtime Library (Static or Dynamic)?

Screenshot for the target option in the IDE. enter image description here


Solution

  • There is RUNTIME_LIBS, documented in build\msw\config.vc file, make option which can be used to select the kind of CRT to use. In your case you want to add RUNTIME_LIBS=static to your make command line. I.e. the full command becomes

    nmake /f makefile.vc BUILD=release RUNTIME_LIBS=static
    

    (MONOLITHIC, SHARED and UNICODE values you use are the defaults anyhow, so you can just as well omit them).