![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
You know how these mechanics are. Gotta go back five times and pay a fortune (depends on the difficulty of the newbies request, of couse, how well it works).
__________________
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 |
|
|
|
|
|
#12 |
|
PFO Founder
![]() ![]() |
The 2 threads have been merged since there was info in both of them.
__________________
BIG K aka Kyle Programming Forums Kyle K Online Please do not PM or email me programming questions. Post them in the forums instead. |
|
|
|
|
|
#13 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Thanks, Big K. One of the days (oh, yeah, right) cross-posting will be a historical novelty.
__________________
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 |
|
|
|
|
|
#14 |
|
Programmer
Join Date: Jun 2005
Posts: 99
Rep Power: 4
![]() |
As of visual studio 2003 the .cpp extension could be a C++ source file or a managed C++ source file, there's no way for the IDE to guess what compiler to use anymore. Keeping things in projects is neater anyhow and you dont have to guess what settings the compiler is going to use - its all in the project settings.
|
|
|
|
|
|
#15 |
|
Programmer
Join Date: Mar 2006
Location: Tennessee
Posts: 41
Rep Power: 0
![]() |
For a single .cpp, all you have to do is make a workspace and it will compile, no need to create a project. At least that's how it works on my VS 6.0. And it usually tells me I need to create a workspace and prompts me to do so, to build and compile the file when I click the ! button.
|
|
|
|
|
|
#16 |
|
Hobbyist Programmer
Join Date: Jan 2006
Location: UK
Posts: 214
Rep Power: 3
![]() |
is different in 2003 and 2005 .net PPoA.
as said before create new project then in the source folder on the solution explorer add existing item and select the .cpp you wish to add or add a new .cpp. then the compile and build as if by magic ![]() |
|
|
|
|
|
#17 |
|
Newbie
Join Date: Feb 2006
Location: India
Posts: 25
Rep Power: 0
![]() |
the problem i was refering to in post#8 is that if there are two or more SEPARATE .cpp files in the project , they would have two 'mains'.
And when there are two 'mains' , build error says : main already defined So is it not possible to have two or more programs in the project? The previous program has to be excluded frm the proj to build a new one |
|
|
|
|
|
#18 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
You may have as many source files as you like. You may not have two "main"s. Main is the main (imagine that) function for your program. It is the one the wrapper code calls when it has directed the system how to set up various memory areas and file-handles for your use. Obviously, your program should only have one of those. Rename the other one, and change all references you might have to it to a new name. Be sure you don't try to call main. It's allowed in C, though doing it indicates a fair degree of ignorance. It's non-compliant for C++.
__________________
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 |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|