简体   繁体   English

如何使用VC ++ 2008在Windows上从命令行编译C ++文件?

[英]How do I compile C++ files from the command-line on Windows with VC++2008?

I'm curious to find a way to compile .cpp files from the Windows command prompt. 我很好奇,想找到一种从Windows命令提示符下编译.cpp文件的方法。 Is there a way to do so with Visual Studio? 有没有办法用Visual Studio做到这一点? The only compiler I've got is VC++2008. 我唯一拥有的编译器是VC ++ 2008。 So can I define VC++ to be my system's compiler? 那么我可以将VC ++定义为系统的编译器吗?

There is Visual Studio 2008 Command Prompt item under the start menu item All Programs -> Microsoft Visual Studio 2008 -> Visual Studio Tools . 在开始菜单项“ 所有程序”->“ Microsoft Visual Studio 2008”->“ Visual Studio工具”下,没有Visual Studio 2008命令提示符项。 It will launch a command prompt with the environment correctly configured to enable you to run cl.exe , link.exe , etc. 它将在正确配置环境的情况下启动命令提示符,以使您能够运行cl.exelink.exe等。

Some useful links: 一些有用的链接:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在VC 2005(C ++)中从命令行创建字符串预处理器定义? - How to make a string preprocessor definition from command-line in VC 2005 (C++)? 为什么此C程序在VC ++ 2008中返回正确的值? - Why is this C program returning correct value in VC++2008? 将AfxGetMainWnd上的C样式系列转换从VC6 / MFC6转换为在现代MFC版本(VC ++ 2008及更高版本)中运行 - Converting C-style series of casts on AfxGetMainWnd from VC6/MFC6 to operate in modern MFC version (VC++2008 and later) 如何从命令行编译/使用 MSVC 中的 header 单元? - How to compile/use header units in MSVC from command-line? VC ++ 2008项目始终“过时” - VC++2008 project always “out of date” 如何从命令行编译C ++项目 - How to compile C++ Projects from Command Line 如何自动化(从命令行)安装 Visual Studio Build Tools 构建环境,适用于 C++、.NET、C# 等 - How to automate (from command-line) the installation of a Visual Studio Build Tools build environment, for C++, .NET, C#, etc 为什么我不能在VC ++ 2008中编译这个非CLR程序? 怎么做? - Why can't I compile this non-CLR program in VC++ 2008? How to do it? 在Windows 2008 R2上构建旧的VC 6 C ++应用 - Build old VC 6 C++ apps on Windows 2008 R2 VC ++ 2008中制作的C ++ EXE可在Windows 7上运行,但不能在XP上运行 - C++ EXE made in VC++ 2008 runs on Windows 7 but not XP
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM