1.

Solve : Visual Studio Command Prompt error?

Answer»

I entered a program in Visual Studio C++, then I saved it in the default DIRECTORY as Sample.cpp.

The default directory it was saved into was:

C:\Documents and Settings\User\My Documents\Visual Studio 2005\Projects

I went into the Visual Studio Command Prompt and TRIED to compile it. The following happened:



If I move Sample.cpp to C:\Program Files\Microsoft Visual Studio 8\VC without putting it any sub-directories, just leaving it in that folder, then it compiles fine. But I don't want to have to keep all my .cpp files, my .exe files and my .obj files in that folder, it is really inconvenient.

Does anybody know a way to change it so I can compile my .cpp files from anywhere to anywhere I like?The compiler likely needs a path pointer to your source file.

Code: [Select]cl /EHsc "C:\Documents and Settings\User\My Documents\Visual Studio 2005\Projects\Sample.cpp"

Any reason you're using the command line and not the IDE?


Yes. I don't know how to compile with the IDE. LOL I dont have idea about your problem pleas ask any computer experts about your problem!!!!!!!!!!!
_huhu-Quote from: garydeen on September 09, 2008, 06:12:50 AM

I dont have idea about your problem pleas ask any computer experts about your problem!!!!!!!!!!!
_huhu-

garydeen, please do not make posts like that in future.I personally have Visual Studio 2008, but assuming they are the same, under the Build menu should be Build SOLUTION and Build 'Project Name.' Under the Debug menu, there should be 'Start Debugging.' Personally I just click Start Debugging, because it builds the project and at the same time lets me test out any new features I added/changes I made. I would think using the IDE to compile a program would be easier than using the command prompt...

In addition, I believe there's an option when you first make a project, called "Create Directory For Solution." If this box is checked, it should make a directory only for that project, and Visual Studio should always refer to that directory to compile it.

Like I said, I'm basing this from Visual Studio 2008, and despite how similar 2008 and 2005 are, there may be differences.

~ BaRR


Discussion

No Comment Found