【发布时间】:2011-02-11 22:10:49
【问题描述】:
1>Project : error PRJ0003 : Error spawning 'rc.exe'.. 这是我尝试运行这个读写文件的小练习程序时遇到的错误,由于我的原因我不能这样做能够正确打开文件。我使用 microsoft visual c++ 2008,并且我也使用文件路径尝试打开文件,但我不能有人帮忙吗?
#include <iostream>
#include <fstream>
using namespace std;
int main ()
{
ifstream infile;
ofstream myfile;
int num;
infile.open("example.txt");
if(infile.fail())
{
cout << "error" << endl;
}
myfile.open ("example.txt");
if(infile.fail())
{
cout << "error" << endl;
}
while(!infile.eof())
{
example >> num;
}
while(!myfile.eof())
{
example << num;
}
infile.close();
myfile.close();
return 0;
}
【问题讨论】:
-
嗨,欢迎来到 SO。您可以通过突出显示并按 ctrl-k 来正确格式化代码。
-
非常感谢我不知道
-
看起来你的错误不是在运行程序,而是在编译它。
-
查看你的源码和生成rc.exe的错误,两者不匹配,你还想做什么?你有一个make文件,它在做什么? rc.exe 是资源编译器,我在代码中看不到任何与资源相关的内容。
标签: c++ visual-c++ fatal-error