www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/03/24/11:27:44

Date: Fri, 24 Mar 1995 08:37:15 -0500 (CDT)
From: Aaron Ucko <UCKO AT VAX1 DOT ROCKHURST DOT EDU>
Subject: Re: Problems compiling C++ programs
To: 76451 DOT 2647 AT compuserve DOT com
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Organization: Rockhurst College; Kansas City, MO

>c:\>gcc -v string4.cpp -o string

You keep C++ programs in the root directory?!
Aside from that, however, this line reveals one (or maybe two) mistakes you
made:  You forgot to have gcc link in the iostream stuff (which you can do
by specifying -lgpp or -liostream); this would account for many of your
undefined symbols.  You also probably need to give GCC the -O or -O2 flag
so it can perform optimization (including inlining (!)).

>I've tried using all kinds of command-line directives to make sure the proper
>library and include files are found; I even matched the individual headers in
>the djgpp\cplusinc directory to make sure there were no naming differences (I
>only found 1 so far - "_string.h", but no "string.h") and adjusted the #include

that's because DOS uses a case-insensitive filesystem, so otherwise there
would be no way to tell string.h from String.h.  If all you need is the ANSI
C standard library string functions, however, just include string.h (which is
included by _string.h).

--- Aaron Ucko (ucko AT vax1 DOT rockhurst DOT edu; finger for PGP public key) | httyp!
Geek code 2.1 [for explanation, finger hayden@ | `God's Laws' (Rudy Rucker,  
vax1.mankato.msus.edu]: GCS/M/S d(-) H s g+ p? \ _Master of Space and Time_):
!au a17 w+ v+(++) C++(+++)>++++ UL++(S+)>++++	\ 1) Be clean. 2) Follow Gary.
P+(++) L++ 3(-) E- N+(++) K- W--(---) M-@ V-(--) \ 3) Teach God's Laws.
po-(--) Y+ t(+) !5 j(++) R(-) G' tv--(-) b+++	  +---------------------------
!D(--) B--(---) e>++++(*) u++(@) h!() f(+) r-(--)>+++ n+(-) y?

- Raw text -


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