Programing Newbie Help VS 2010 compiler error?

DestinyR

New member
Jul 25, 2008
4
0
1
I got VS 2010. Made a simple program (Sample.cpp). Went to the VS Command prompt. C:\...>cl -GX Sample.cpp. Access is denied, why? How do i get access to my own file?

I am running windows 7.
the program is simple as such:
/*
This is a simple C++ program.
*/
#include <iostream>
using namespace std;
// A C++ program begins at main().
int main()
{
cout << "C++ is power programming.";
return 0;
}
saved with word pad and tried to compile to exe. please help.
Did what jim suggested, wrote all in new wpp program. Changed the (-) to (/). VS 2010 says "Access is Denied"
 
DON'T use wordpad. 50/50 chance of it not coming out as a text file.
bad instructor for not showing you around to any tools!
use a programmer's editor like notepad++. to edit your source, batch, and makefiles.
use /MT /GX /O2 instead of -GX

-GX isn't proper on CL. /GX is. you just have to know how to use switches in windows programs. some programs like - and some like / and you have to try to figure out which one it likes, usually by doing /?, -? /help or --help and sometimes no arguments gives help and sometimes it doesn't.

/MT is multithreaded monolithic executable, rather than forcing you to distribute with the msvcrt90.dll.
/O2 is optimize for fast


my favorite editor is the semware editor. it runs rings around notepad++ for editiing everything from databases to whatever.
 
Back
Top