简体   繁体   中英

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. 在此处输入图片说明

nmake does not accept the same options your compiler accepts. It just doesn't work this way. You control the compiler and other programs invoked by nmake by creating and editing makefiles . You can find one such makefile in the list of command line arguments, it's the one after -f .

If you want to use a tool from the make family you must try to read and understand at least a basic make tutorial. I will not attempt to explain make from scratch here.

If your makefile is not too complex you might be able to figure out the required changes on your own, but I highly recommend reading a basic make or nmake tutorial anyway.

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. Ie 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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM