delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/11/19:32:18

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: [Q] newbie question...
Date: Thu, 11 Dec 1997 19:08:01 +0000
Organization: Two pounds of chaos and a pinch of salt
Lines: 41
Message-ID: <34903A11.3567@cs.com>
References: <Pine DOT OSF DOT 3 DOT 96 DOT 971211142402 DOT 17866C-100000 AT alfa DOT ist DOT utl DOT pt>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp203.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Tron wrote:
> 
>   djgpp is a c++ compiler isnt??? how can i compile c file name.cpp with
> gcc...
> 
>   like we do with c files
> example: gcc -Wall -c name.c bla...bla...bla...

I assume that after this command, you use something like:

gcc -o name.exe name.o

Otherwise, that '-c' parameter isn't going to do what you expect.

In any case, there are two things you must to in order to build C++
programs with DJGPP.  You must install the C++ compiler and libraries
(v2gnu/gpp2721b.zip and v2gnu/lgp271b.zip), and you must link the C++
libraries when you compile.

In one step:

gcc -Wall -o name.exe name.cpp -lgpp

In two steps:

gcc -Wall -c name.cpp
gcc -o name.exe name.o -lgpp

You can also substitute 'gxx' for 'gcc', which adds '-lgpp' to the
command line automatically.

This is all in the documentation, btw, which I suggest you read.

hth
-- 
---------------------------------------------------------------------
|      John M. Aldrich       | "Money is truthful.  If a man speaks |
|       aka Fighteer I       | of his honor, make him pay cash."    |
|   mailto:fighteer AT cs DOT com   |                                      |
| http://www.cs.com/fighteer |               - Lazarus Long         |
---------------------------------------------------------------------

- Raw text -


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