我一直在使用Microsoft Visual Studio 2010命令提示符编译原始.cpp文件并分析它们的输出的应用程序。我遇到了很多麻烦,网上似乎没有太多材料。这里的麻烦代码:从另一个.cpp文件的主体编译.cpp文件
#include <iostream>
using namespace std;
...
string name = "cl /EHsc ";
name += "example.cpp";
system("setupcppenv.bat"); // A short batch file I wrote to launch the VC++ cmd prompt without launching another instance of cmd
system(name.c_str());
当我执行(它试图编译example.cpp),我得到一个错误:
fatal error C1043: iostream: no include path set
我不是很有经验的批处理文件,或者使用命令提示编译器。我究竟做错了什么?!
此外,是否有不同的方式来从应用程序内部编译?
谢谢!