www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/11/08/02:22:33

Date: Wed, 8 Nov 1995 08:41:10 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Teng Yong Jeffrey <93602081 AT neptune DOT np DOT ac DOT sg>
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: Help regarding GPP

On Wed, 8 Nov 1995, Teng Yong Jeffrey wrote:

> But when I try to use the functions in gppconio.h (gotoxy),
> gcc gives me "undefined reference to 'gotoxy'"
[snip]
> What I don't get is, from the FAQ, it seems like just by getting and 
> unzipping the two files GPP263.zip and LGP262bn.zip, I can use the 
> C++ functions already. So how come GCC gives me these errors?

This has nothing to do with C++. conio functions are in the libpc.a 
library, and the linker doesn't search it by default.  This is explained 
in the FAQ (get the latest in faq102.zip, if you don't have it already), 
section 8.8:

8.8   Q: When I compile my program, the linker complains about mathematical
         functions, although I did #include <math.h>.
      Q: The linker complains it cannot find cprintf function.
      Q: Why do I get so many unresolved symbols when linking C++ programs?
      A: By default, gcc instructs the linker to only look in two libraries:
         libgcc.a and libc.a.  Some functions aren't included there, so the
         linker can't find them.  For math functions, like sin() and exp(),
         append ``-lm'' to the gcc command line; for pc-specific
         functions, like cputs() and cprintf() append ``-lpc''; to use C++
         classes append ``-lgpp''.  GPL library routines, like obstack and
         regex packages are in libgpl.a library; append ``-lgpl'' to use
         them.

It's probably worthwhile to also read a few sections which follow 8.8 
and discuss related issues.

- Raw text -


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