Does a file have to have a corresponding project associated with i

B

BigDaddyCool

For example, if I'm in Visual C++ 2008 and I go to File --> New --> File...
and I click on Visual C++ and click on "C++ File (.cpp)", that creates a new
..cpp file called Source1.cpp. If I start typing in some code, is there any
way to get this code to compile and run or do I have to start a new project?
 
M

Mark Salsbery [MVP]

BigDaddyCool said:
For example, if I'm in Visual C++ 2008 and I go to File --> New -->
File...
and I click on Visual C++ and click on "C++ File (.cpp)", that creates a
new
.cpp file called Source1.cpp. If I start typing in some code, is there any
way to get this code to compile and run or do I have to start a new
project?


The project file has all the compiler and linker options.

If you try it, you'll see there's no build options available for the
stand-alone file.
You would need to compile from the command line.

Mark
 
H

H Brydon

Mark Salsbery said:
The project file has all the compiler and linker options.

If you try it, you'll see there's no build options available for the
stand-alone file.
You would need to compile from the command line.

Mark

NOT TRUE! You do not need to compile from the command line. You can add the
source file to the project and it will compile just fine.

To do this, right click on the project, and select "Add existing" ... follow
the prompts.
 
B

Ben Voigt [C++ MVP]

NOT TRUE! You do not need to compile from the command line. You can add
the source file to the project and it will compile just fine.

To do this, right click on the project, and select "Add existing" ...
follow the prompts.

I think you missed the point, which was how to compile a file without having
a project...
 
A

Allen

You said: I think you missed the point, which was how to compile a file
without having
a project...

You can select "Empty Project. " from the template
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top