delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/11/25/12:15:14

From: "A. Sinan Unur" <asu1 AT c-o-r-n-e-l-l DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: about: aout.exe
Date: 25 Nov 2002 17:11:21 GMT
Organization: Cornell University
Lines: 48
Sender: asu1 AT cornell DOT invalid (on 128.253.251.141)
Message-ID: <Xns92D17BFF1E467asu1cornelledu@132.236.56.8>
References: <3DDFA0CA DOT 000009 DOT 03244 AT DELL> <Xns92CF728D3F9Aasu1cornelledu AT 132 DOT 236 DOT 56 DOT 8> <63b211f7 DOT 0211240900 DOT a1f0a57 AT posting DOT google DOT com> <Xns92D096DC170A6asu1cornelledu AT 132 DOT 236 DOT 56 DOT 8> <63b211f7 DOT 0211250711 DOT 7d6a37a5 AT posting DOT google DOT com>
NNTP-Posting-Host: 128.253.251.141
X-Trace: news01.cit.cornell.edu 1038244281 15165 128.253.251.141 (25 Nov 2002 17:11:21 GMT)
X-Complaints-To: usenet AT news01 DOT cit DOT cornell DOT edu
NNTP-Posting-Date: 25 Nov 2002 17:11:21 GMT
User-Agent: Xnews/5.04.25
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

shayoom AT hotmail DOT com (Jonquil) wrote in news:63b211f7.0211250711.7d6a37a5
@posting.google.com:

> i understand that you no longer use rhide, so, if you cant answer me
> here i hope someone else will.. ;)

did setting targetname to the full path of the executable you want 
created not help?

>> on the other hand, you can save yourself some time by learning a few 
>> command lines:
>> 
>> gcc -Wall -O2 hello.c -o hello.exe
>> 
> i tried this line, and im glad you told me about it,,, i didnt really
> enjoy adding/deleting projects to run my programs, though i am sure
> that i will NEED them soon to run longer ones..
> anyway, i ran my hello.cpp program using projects and it worked well..
> i ran the same program using the command above, and i got some errors
> about using std::cout.. etc..

first, it is good practice to post the exact error messages you get: help 
others help you.

for C++ source, you can use gpp to compile and link with the standard C++ 
libraries using the command line:

gpp -Wall -O2 hello.c -o hello.exe

or you can explicityly specify the libraries on the command line using 
gcc.

by the way, make sure you use the standard C++ headers, rather than the 
old-style headers. the latter will cause gcc to issue warnings:

#include <iostream>

int main()
{
  std::cout << "Hello World!\n";
}


-- 
A. Sinan Unur
asu1 AT c-o-r-n-e-l-l DOT edu
Remove dashes for address
Spam bait: mailto:uce AT ftc DOT gov

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019