Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 27th, 2006, 11:27 AM   #11
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Old Mar 27th, 2006, 11:31 AM   #12
big_k105
PFO Founder

 
big_k105's Avatar
 
Join Date: Mar 2004
Location: Fargo, ND
Posts: 1,630
Rep Power: 10 big_k105 is on a distinguished road
Send a message via AIM to big_k105 Send a message via MSN to big_k105 Send a message via Yahoo to big_k105
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.
big_k105 is offline   Reply With Quote
Old Mar 27th, 2006, 11:32 AM   #13
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Old Mar 27th, 2006, 7:24 PM   #14
Animatronic
Programmer
 
Join Date: Jun 2005
Posts: 99
Rep Power: 4 Animatronic is on a distinguished road
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.
Animatronic is offline   Reply With Quote
Old Mar 27th, 2006, 7:39 PM   #15
PPoA
Programmer
 
PPoA's Avatar
 
Join Date: Mar 2006
Location: Tennessee
Posts: 41
Rep Power: 0 PPoA is on a distinguished road
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.
PPoA is offline   Reply With Quote
Old Mar 27th, 2006, 8:00 PM   #16
Seif
Hobbyist Programmer
 
Seif's Avatar
 
Join Date: Jan 2006
Location: UK
Posts: 214
Rep Power: 3 Seif is on a distinguished road
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
Seif is offline   Reply With Quote
Old Mar 28th, 2006, 6:40 AM   #17
sharadpro
Newbie
 
Join Date: Feb 2006
Location: India
Posts: 25
Rep Power: 0 sharadpro is on a distinguished road
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
sharadpro is offline   Reply With Quote
Old Mar 28th, 2006, 6:50 AM   #18
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:00 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC