delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/08/23/03:30:14

From: <kvogt AT UVic DOT CA>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: gcc 'undefined reference' error
Date: Thu, 23 Aug 2001 00:17:21 -0700
Organization: University of Victoria
Lines: 109
Message-ID: <Pine.A41.4.32.0108222322260.84838-100000@unix5.uvic.ca>
References: <Pine DOT A41 DOT 4 DOT 32 DOT 0108222140240 DOT 126880-100000 AT unix5 DOT uvic DOT ca> <3405-Thu23Aug2001084102+0300-eliz AT is DOT elta DOT co DOT il>
NNTP-Posting-Host: unix5.uvic.ca
Mime-Version: 1.0
X-Trace: casper.uvic.ca 998551118 25326 142.104.5.117 (23 Aug 2001 07:18:38 GMT)
X-Complaints-To: abuse AT uvic DOT ca
NNTP-Posting-Date: Thu, 23 Aug 2001 07:18:38 +0000 (UTC)
In-Reply-To: <3405-Thu23Aug2001084102+0300-eliz@is.elta.co.il>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
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

Thanks for replying so quickly. I must have assumed that ScreenMode() is
defined in "pc.c", but that was wrong. I realize now that I don't have
that file (in fact, I don't have scmode.c either).

I actually don't care about that specific function.

I am trying to use
a program called PCTimer, which uses the following functions that my
linker has trouble with. Some of these are declared in pc.h; I should have
used one of them, rather than ScreenMode(), in my example.

__dpmi_simulate_real_mode_interrupt
__dpmi_simulate_real_mode_procedure_iret
_go32_dpmi_allocate_real_mode_callback_iret
_go32_dpmi_chain_protected_mode_interrupt_vector
_go32_dpmi_free_real_mode_callback
_go32_dpmi_get_protected_mode_interrupt_vector
_go32_dpmi_get_real_mode_interrupt_vector
_go32_dpmi_lock_code
_go32_dpmi_lock_data
_go32_dpmi_set_real_mode_interrupt_vector
_go32_my_cs
biostime
disable
disable
enable
getch
inportb
outportb

PCTimer consists mainly of 'gccint8.h' and 'gccint8.c'. If you are
interested, I posted those files at
"http://www.csc.uvic.ca/~kvogt/pctimer/".

I also posted my verbose gcc output at the same location. I named it
'gcc.txt'.

I just installed DJGPP today, using the following zip files:
alleg312.zip
bnu2112b.zip
djdev203.zip
em2005b.zip
em2005li.zip
faq230b.zip
fil40s.zip
gcc2953b.zip
gpp2953b.zip
grx243s.zip
mak3791b.zip
rh1478b.zip
rsxdj151.zip
txi40b.zip

Now I'm wondering if I have the files necessary to run gccint8.c. For
example, given the above zip files, the function outportb() (declared in
pc.h) is defined in a number of .c files. All but one of those .c files
are below djgpp/allegro/. The remaining .c file that defines outportb() is
C:\DJGPP\contrib\grx243\src\bgi\rgbpal_g.c. Is that what I should be
using? If so, how do I tell the linker?

Kevin



On Thu, 23 Aug 2001, Eli Zaretskii wrote:

> > 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