compiling .cpp in visual studio

Reply

Join Date: Jun 2009
Posts: 29
Reputation: PopeJareth is an unknown quantity at this point 
Solved Threads: 3
PopeJareth PopeJareth is offline Offline
Light Poster

compiling .cpp in visual studio

 
0
  #1
Sep 1st, 2009
Is it possible to compile a single .cpp (not a project) in visual studio 2008? Also will using visual studio cause problems executing code on a unix system?

I am making my first c++ "hello world" program and I am attempting to use visual studios. Am I going to have to make a project for every little thing I program?

It almost seems like a joke to have resource.h, stdafx.h, app.ico, app.rc, AssemblyInfo.cpp, stdafx.cpp, and Hello.cpp just for "hello world" lol.

Thanks for your help and advice on the matter. =)
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 1,522
Reputation: William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of 
Solved Threads: 127
William Hemsworth William Hemsworth is offline Offline
Posting Virtuoso

Re: compiling .cpp in visual studio

 
0
  #2
Sep 1st, 2009
AFAIK, you have to make a project first, and then add the main.cpp file as a source. Unless you want to do it manually using the Visual Studio 2008 command prompt and "cl.exe" to compile.
I need pageviews! most fun profile ever :)
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 16,594
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1614
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Still Learning

Re: compiling .cpp in visual studio

 
-7
  #3
Sep 1st, 2009
>>Is it possible to compile a single .cpp (not a project) in visual studio 2008
No.

>>Also will using visual studio cause problems executing code on a unix system?
If you mean run the *.exe on *linux, the answer is that it cannot. You will have to compiler it on the machine you want to run it on, in this case a *nix computer. The binaries are not compatible between the two operating systems.

>>It almost seems like a joke to have resource.h, stdafx.h, app.ico, app.rc, AssemblyInfo.cpp, stdafx.cpp, and Hello.cpp just for "hello world" lol.

You can create an empty project and add your own *.cpp file(s) to it.
Last edited by Ancient Dragon; Sep 1st, 2009 at 7:22 pm.
The most important thing in the Olympic Games is not to win but to take part, just as the most important thing in life is not the triumph but the struggle. The essential thing is not to have conquered but to have fought well.
-Pierre de Coubertin, The Olympic Creed Inspired by Bishop Ethelbert
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 1,522
Reputation: William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of 
Solved Threads: 127
William Hemsworth William Hemsworth is offline Offline
Posting Virtuoso

Re: compiling .cpp in visual studio

 
0
  #4
Sep 1st, 2009
>It almost seems like a joke to have resource.h, stdafx.h, app.ico, app.rc, AssemblyInfo.cpp, stdafx.cpp, and Hello.cpp just for "hello world" lol.

You don't need all those files, when making a new project, remember to choose "Empty Project" in the additional options while in the wizard.
Last edited by William Hemsworth; Sep 1st, 2009 at 7:22 pm.
I need pageviews! most fun profile ever :)
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 1186 | Replies: 3
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC