![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Feb 2006
Location: India
Posts: 25
Rep Power: 0
![]() |
Compiling .cpp file using Microsft Visual Studio 2005
Can anyone pls tell me how to compile n build a single .CPP file<program>
using Microsoft Visual Studio 2005 <Express Edition>without creating a project n solution as is possible in Visual Studio 6. When I make a .CPP file in Visual Studio 05, there is no option to build or compile the program until I make a project , while in VS 6 , one can complie a single a .CPP file. |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
This is my experience (possibly I haven't exhaused all measures): one can make a source file without a project, but one cannot build it. Incidentally, .cpp files are C++ files, so this should be in that forum.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
See my answer under your post in the C forum. Please don't cross-post. Please DO read the forum's rules/FAQ and a "How to Post" thread (always a good move for a new member in a community).
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#4 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
You cannot do that anymore. You can do that with some other IDE like Dev-C++ though. You can also just compile a native C++ program from the command line.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
|
#5 |
|
Expert Programmer
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 3
![]() |
Please do not crosspost. AFAIK, there is no such option. A solution is, I use this one, to create a project you use for only one or two files. You add the file to the project, you compile it, and you exclude it from your project again.
|
|
|
|
|
|
#6 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
I have an "examples" project. I just move stuff in and out of it.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#7 | |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
Quote:
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
|
|
#8 |
|
Newbie
Join Date: Feb 2006
Location: India
Posts: 25
Rep Power: 0
![]() |
When I make an empty project n compile a single file , it is fine but when I add program to it
Error on build :: error LNK2005: _main already defined How to solve this? |
|
|
|
|
|
#9 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
First guess: two source files in the project, both with a "main." I think my crystal needs new 'ball' joints....
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#10 |
|
Hobbyist Programmer
Join Date: Jan 2006
Location: UK
Posts: 213
Rep Power: 3
![]() |
Thought you only just got them changed?
![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|