delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/09/29/02:16:10

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: jbs30000 AT aol DOT com (Joel)
Newsgroups: comp.os.msdos.djgpp
Subject: undefined reference to error
Date: 28 Sep 2003 23:07:06 -0700
Organization: http://groups.google.com/
Lines: 51
Message-ID: <84e4e2a9.0309282207.1769af24@posting.google.com>
NNTP-Posting-Host: 152.163.252.163
X-Trace: posting.google.com 1064815632 18409 127.0.0.1 (29 Sep 2003 06:07:12 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: 29 Sep 2003 06:07:12 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

OK, I'm writting a program with several moduals.  Right now, all of
the routines have to do with SVGA graphics.  I have routines to handle
8, 15, 16, 24, and 32 bit graphics modes, as well as banked and linear
modes.
When a mode is chosen, it is checked to see how many colors are used,
and if it's banked or linear, then a couple of jump tables are set
accordingly.
I'll try to give all the relevant routines.  I hope that this doesn't
make the post too long.
For example, the routines for plotting and getting the color at a
certain location for 8 bit modes are:
void Bank_Plot_8(unsigned short X, unsigned short Y, unsigned char R,
unsigned char G, unsigned char B, unsigned char LO);
void Linear_Plot_8(unsigned short X, unsigned short Y, unsigned char
R, unsigned char G, unsigned char B, unsigned char LO);
unsigned long Bank_Point_8(unsigned short X, unsigned short Y);
unsigned long Linear_Point_8(unsigned short X, unsigned short Y);
and in the Header file for these routines I have:
extern void Bank_Plot_8(unsigned short X, unsigned short Y, unsigned
char R, unsigned char G, unsigned char B, unsigned char LO);
extern void Linear_Plot_8(unsigned short X, unsigned short Y, unsigned
char R, unsigned char G, unsigned char B, unsigned char LO);
extern unsigned long Bank_Point_8(unsigned short X, unsigned short Y);
extern unsigned long Linear_Point_8(unsigned short X, unsigned short
Y);
Now, for the jump tables, I have:
void (*Plot_Pixel)(unsigned short X, unsigned short Y, unsigned char
R, unsigned char G, unsigned char B, unsigned char LO);
unsigned long (*Pixel_Point)(unsigned short X, unsigned short Y);
And, in the Header file:
extern void (*Plot_Pixel)(unsigned short X, unsigned short Y, unsigned
char R, unsigned char G, unsigned char B, unsigned char LO);
extern unsigned long (*Pixel_Point)(unsigned short X, unsigned short
Y);
Now, here's part of the routine to assign a linear address to the jump
tables:
void Linear_PTR_Set()
{
                switch(ModeInfo.Bits_Per_Pixel)
                {
                        case 8:
                             Plot_Pixel = &Linear_Plot_8;
                             Pixel_Point = &Linear_Point_8;

Now, the funny thing is, Plot_Pixel = &Linear_Plot_8; is just fine,
but in the message window shown by RHIDE, I get this:
Error: undefined reference to `Linear_Point_8(unsigned short, unsigned
short)
This error also applies to all the other Liner_Point's (_15, _16,
etc...) and all the Bank_Point routines.
What am I doing wrong here?  Thank you.

- Raw text -


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