954,505 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

"Build" in VS Express

Hi!
Is there a way that I can "Build" a single source file? Wihout creating a project? I want to be able to open a *.c file in Visual Studio and simply Build it with out having to choose a project. I know it's a whole different world but in Borland C for DOS I simly opened a file and hit Ctrl+F9.

Thanks.

amishosh
Junior Poster in Training
59 posts since Oct 2006
Reputation Points: 10
Solved Threads: 0
 

I don't think you can build just an open file. But you can make a dummy project and get the same effect by removing the source files in the project and adding existing items instead of new items to it each time.

Hamrick
Posting Whiz
325 posts since Jun 2007
Reputation Points: 180
Solved Threads: 34
 

The easiest way for a single file is to type
cl prog.c
at the command prompt.

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

When you open a single file in Visual Studio (VC 6.0++), what it will ask if you want to open an project workspace. That is just something it needs internally and doesn't actually create a project. Just click on yes and you can compile a single file.

Tight_Coder_Ex
Posting Whiz in Training
215 posts since Feb 2005
Reputation Points: 47
Solved Threads: 17
 

The way I do it is somewhat like Hamrick suggested -- create a project then change the source file(s) as needed. I test out many of the programs posted on the C and C++ boards that way.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 
The way I do it is somewhat like Hamrick suggested -- create a project then change the source file(s) as needed. I test out many of the programs posted on the C and C++ boards that way.

I kind of overlooked the fact that maybe you want to run the app in some way. My method only compiles the file, nothing else.

Tight_Coder_Ex
Posting Whiz in Training
215 posts since Feb 2005
Reputation Points: 47
Solved Threads: 17
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You