delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/08/23/01:44:11

Date: Thu, 23 Aug 2001 08:41:03 +0300
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: kvogt AT UVic DOT CA
Message-Id: <3405-Thu23Aug2001084102+0300-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.9
CC: djgpp AT delorie DOT com
In-reply-to: <Pine.A41.4.32.0108222140240.126880-100000@unix5.uvic.ca>
(kvogt AT UVic DOT CA)
Subject: Re: gcc 'undefined reference' error
References: <Pine DOT A41 DOT 4 DOT 32 DOT 0108222140240 DOT 126880-100000 AT unix5 DOT uvic DOT ca>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: <kvogt AT UVic DOT CA>
> Newsgroups: comp.os.msdos.djgpp
> Date: Wed, 22 Aug 2001 21:59:07 -0700
> 
> Sample code:
> #include <stdio.h>
> #include <pc.h>
> int main( void )
> {
>    ScreenMode(); // declared in pc.h, defined in pc.c
>    return 1;
> }
> 
> gcc command:
> gcc -o test.exe test.c -lpc
> 
> error:
> c:/djgpp/tmp\ccFN3J0x.o(.text+0x78):test.c: undefined reference to
> "ScreenMode"

Something is very wrong with your installation.  What version of DJGPP
do you have?  The current version is 2.03, and there ScreenMode is
defined on the file scmode.c, not on pc.c, as you say above.  (How did
you find out the name of pc.c, anyway?)

> I get the error with other functions within pc.h, and also with other
> functions from other libraries. I checked that libpc.a is in my 'lib'
> directory.

Unless you have a very old v1.x version of DJGPP, libpc.a is an empty
library, kept only for backward compatibility.  All the functions that
were in libpc.a are now in libc.a.

What about libc.a--do you have it in your lib subdirectory?  What is
its size and time stamp?

> As far as I know, I am using the proper versions for
> everything.

Please post those versions here.  In particular, what djdevNNN.zip
file did you install?  We need to know the number NNN in that name.

- Raw text -


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