views:

676

answers:

2

1>Project : error PRJ0003 : Error spawning 'rc.exe'.. this is the error i get when i try to run this small practice program of reading and writing files which i cant do because of the reason of me not being able to get the files to open correctly. i use microsoft visual c++ 2008 and i have used the file path to try to open the file as well and i cant can someone help?

#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;
}
+1  A: 

There's something wrong with your setup of Visual Studio, it should never have any trouble finding and running rc.exe. First thing to check if the file is there. It should be located in c:\program files\microsoft sdks\windows\v6.0a\bin\rc.exe.

Next thing to check is that the paths are set properly. Tools + Options, Projects and Solutions, C++ Directories. Upper right: Show directories for = Executable files. Verify that $(WindowsSdkDirs)\bin is listed there. Try adding the folder name explicitly. If the latter step works then your registry is messed up. Despair a bit, rerun Setup.exe and choose Repair.

Hans Passant
i dont see this file c:\program files\microsoft sdks\windows\v6.0a\bin\rc.exe.and is not opening the files cuz it says i need to declare examples which is the file name. should i reinstall visual C++
No idea what "declare examples" means. But not seeing the file is the root source of the problem. Yes, reinstall.
Hans Passant
A: 

is there anyway that i can update my window so that the rc.exe. can be run?

Ronix