Jan 6, 2013 at 3:56pm UTC
I'm getting an error message stating the file is invalid or corrupt.
#include "stdafx.h"
#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstdlib>
#include <ctime>
#include <cctype>
#include <algorithm>
#include <sstream>
#include <time.h>
#include <vector>
using namespace std;
using namespace System;
void main()
{
string namein;
cout<<"Enter your first name-->";
cin>>namein;
cout<<endl;
cout<<"Your name was: "<<namein;
cout<<endl;
system("Pause");
}
//This is the error message I'm getting//
1>------ Build started: Project: first_assignment-upton,travis, Configuration: Release Win32 ------
1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Last edited on Jan 6, 2013 at 4:13pm UTC
Jan 6, 2013 at 4:10pm UTC
Try not to use system
, its not a good thing to start doing.
I tried this and the only error was the namespace System, remove that and it should work.
In the future use the code brackets
Jan 6, 2013 at 4:28pm UTC
Thank you Pickle Gunner for such a speedy reply but, unfortunately after removing what you suggested I get the same error message. I installed visual studio 2010 express last night and I get an error stating the project is out of date when trying to run it. I am wondering if I just need to uninstall and start fresh. Any suggestions? Thank you in advance.