If you have
Visual Studio 2017, to build a C++ project from a "normal" - not
developer - command line:
- Add the following to system path:
- To use cl.exe: c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bin\Hostx64\x64\
- To use vcvars64.bat: c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\
- Open a command window and issue the following commands
- vcvars64
- If you are in a drive other than C:, let's say D:, you have to issue the command D: because after vcvars64, the drive reverts to C:
- cl a.cpp b.cpp
For example, in order to build
mms-cpp, I created a batch with the following content:
set PATH=%PATH%;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bin\Hostx64\x64\;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\
call vcvars64
d:
call cl API.cpp Main.cpp
Note that there should be no whitespace after "PATH=" and the additional two paths should not be enclosed with
quotation marks.
No comments:
Post a Comment