The ProgrammersTalk Community
Forum Register Search Today's Posts Mark Forums Read
Register

Go Back   The ProgrammersTalk Community > General Programming > C / C++


Welcome to the The ProgrammersTalk Community forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.
Tags: , , ,

Reply
 
LinkBack Thread Tools    Display Modes   
  #1 (permalink)  
Old 08-10-2007, 09:49 AM
HelloWorld's Avatar
HelloWorld HelloWorld is offline
Programming Expert
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: In front of computer...
Posts: 1,111
iTrader: (0)
HelloWorld will become famous soon enoughHelloWorld will become famous soon enoughHelloWorld will become famous soon enough
Icon9 How do you compile your C++ application?

I've a question here, I've a background with Java programming, I wanted to know how do you manually compile C++ if you create the C++ application with a simple text editor such as Textpad or Notepad? Do I also need to specify the %PATH% in the Runtime Environment?

Code:
javac something.java

__________________
PHP Code:
System.out.println("Hello World!"); 

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
  #2 (permalink)  
Old 08-10-2007, 09:21 PM
rpgfan3233 rpgfan3233 is offline
PT Staff
Awards Showcase
Quality Tutorial Quality Tutorial Quality Tutorial Quality Tutorial 
Total Awards: 4
Join Date: Jul 2007
Posts: 118
iTrader: (0)
rpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura about
This varies between C++ implementations, just as it does between various Java implementations ("gcj" is used to invoke the GNU Compiler for Java while "javac" is used to invoke Sun's Java compiler).

cl (CL) - used to invoke the MS VC++ (and VC++.NET, I believe) compiler, not sure why that filename was chosen though...
g++ or c++ - used to invoke the GNU Compiler for C++

I'm not sure about Borland Turbo C++ or Watcom C++ or whatever else since I haven't spent as much time with them (Watcom C++ still used <iostream.h> (the standard header as of c++98 is <iostream>) the last time I tried using it, which was a couple of years ago, unless I was supposed to compile with a specific option to make it require <iostream> instead of requiring <iostream.h>). Though I haven't worked with Comeau's C++ compiler at all, I've heard good things about it.

__________________
"C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off."
-- Bjarne Stroustrup, creator of what is now known as C++
For more quotes by Bjarne Stroustrup, check out http://www.research.att.com/~bs/bs_faq.html#really-say-that.
Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
The Following User Says Thank You to rpgfan3233 For This Useful Post:
HelloWorld (08-12-2007)
  #3 (permalink)  
Old 08-12-2007, 09:52 PM
HelloWorld's Avatar
HelloWorld HelloWorld is offline
Programming Expert
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: In front of computer...
Posts: 1,111
iTrader: (0)
HelloWorld will become famous soon enoughHelloWorld will become famous soon enoughHelloWorld will become famous soon enough
Quote:
This varies between C++ implementations, just as it does between various Java implementations ("gcj" is used to invoke the GNU Compiler for Java while "javac" is used to invoke Sun's Java compiler).
Are these variety just depending on the C++ compiler?
Sorry, I don't understand on what do you mean by "depend on the implementation" ....

__________________
PHP Code:
System.out.println("Hello World!"); 

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
  #4 (permalink)  
Old 08-12-2007, 10:25 PM
rpgfan3233 rpgfan3233 is offline
PT Staff
Awards Showcase
Quality Tutorial Quality Tutorial Quality Tutorial Quality Tutorial 
Total Awards: 4
Join Date: Jul 2007
Posts: 118
iTrader: (0)
rpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura about
Yes, it varies from compiler to compiler. Java has javac for the Sun JDK (Java SE) and also gcj (GNU Compiler for Java). These are two different compilers for java.

For C++, it also varies from compiler to compiler. cl (or cl.exe) is used to invoke the Microsoft Visual C++ compiler and g++ (also g++.exe on Windows and DOS, I believe) is used to invoke the GNU Compiler for C++.

After all, there are quite a few C++ compilers that you can find online. Imagine the idea of having different compilers using the same name on the same computer! Since the PATH environment variable on an operating system dictates the directories to look through for a command that doesn't include a path (e.g. "g++" instead of "c:\mingw\bin\g++"), think about what might happen if you had another compiler directory before the MSVC++ compiler directory and you wanted to invoke the MSVC++ compiler! You would need to call the MSVC++ compiler with a path, such as "c:\program files\microsoft visual studio\VC98\bin\cl". It would be very inefficient, right?

I hope this helped.

__________________
"C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off."
-- Bjarne Stroustrup, creator of what is now known as C++
For more quotes by Bjarne Stroustrup, check out http://www.research.att.com/~bs/bs_faq.html#really-say-that.
Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
The Following User Says Thank You to rpgfan3233 For This Useful Post:
HelloWorld (08-13-2007)
  #5 (permalink)  
Old 08-14-2007, 10:12 PM
ccoonen ccoonen is offline
PT Staff
Awards Showcase
Quality Tutorial Quality Tutorial Quality Tutorial Quality Tutorial 
Total Awards: 4
Join Date: Jun 2007
Location: Wisconsin
Posts: 308
iTrader: (0)
ccoonen is on a distinguished roadccoonen is on a distinguished roadccoonen is on a distinguished roadccoonen is on a distinguished road
G++ Boyeee! If your on a *nix environment that is anyways.
Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 02:28 PM. Powered by vBulletin
Copyright © 2000 - 2007, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO © 2007 ProgrammersTalk Sedo - Buy and Sell Domain Names and Websites project info: programmerstalk.net Statistics for project programmerstalk.net etracker® web controlling instead of log file analysis


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50