delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/05/25/02:13:11

From: j DOT aldrich6 AT genie DOT com
Message-Id: <199605250546.AA133993191@relay1.geis.com>
Date: Sat, 25 May 96 05:37:00 UTC 0000
To: djgpp AT delorie DOT com
Mime-Version: 1.0
Subject: Re: conio.h and -lpc problem

Reply to message 1952339    from JOHN9904 AT XENS on 05/23/96 11:43AM


>      I'm trying to get conio.h functions to work. Before you mention that
>this same question ask been asked and answeres 2^16 times, I know that I
>ought to compile with the -lpc argument. Even with this, I'm getting the
>	D:\DJGPP\PROJ>gcc -lpc clr.c -o clr
>	clr.c(.text+0x14): undefined reference to `getch'
>	clr.c(.text+0x22): undefined reference to `putch'

You need to put the -lpc at the _end_ of the gcc command line, not the
beginning.  ld is a one-pass linker, which means that if it sees -lpc before
the code which uses it, it won't know that it needs to link the functions.

BTW, are you using version 1.12 or version 2.0?  In 2.0, libpc.a is simply
an empty library, as all its functions are included in libc.a.  If you are
using
2.0, then your problem is something other than what I said above.

John

- Raw text -


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