delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/11/22:10:37

From: Joseph Rose <jorose AT mail DOT gis DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Problems linking
Date: Tue, 11 Apr 2000 22:41:36 -0400
Organization: Posted via Supernews, http://www.supernews.com
Lines: 52
Message-ID: <38F3E260.B762A9E@pop.gis.net>
X-Complaints-To: newsabuse AT supernews DOT com
X-Mailer: Mozilla 4.7 [en]C-NECCK (Win98; I)
X-Accept-Language: en
MIME-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I'm creating a library of graphics functions with headers, and ran into
a problem.  I wrote some code to test the library, and couldn't call the
functions.  I get an "undefined reference" error at each function call.
Am I doing something wrong?

BTW, Can I include separate asm code in a C++ class?
--------------------
header:

/*
//Header for VGADr386 library.
//Requires dpmi.h.
*/

 __dpmi_paddr VidBuffer;
 char TmpVidBuffer [64000];
 extern void SetGrMode (void);
 extern void Draw_Line_Horiz (int X, int Y, int Len, char Col);
 void Draw_Line_Vert (long X, long Y, short Len, char Col);
 void Draw_Tri (long X1, long Y1, long X2, long Y2, long X3, long Y3,
char Col);

----------------------------
TestGr:

#include <dos.h>
#include <dpmi.h>
#include <VGADr386.h>

/*using namespace Graphics_2D;*/
int main (void)
{
 int A;
 union REGS Reg;
/* Reg.w.ax=0x13;
 int86 (0x10,&Reg,&Reg);
 __asm ("movw %ax,0x13");
 __asm ("int 0x10");*/
 SetGrMode();
 printf ("","Test");
 Draw_Line_Horiz (0, 10, 32, 15);
 Draw_Line_Horiz (2,20,32,15);
/* Draw_Line_Horiz(310,30,32,15);
 Draw_Tri (160,100,200,150,180,140,15);*/
 sleep (3);
 Reg.w.ax=0x3;
 int86 (0x10,&Reg,&Reg);
 return 0;
};



- Raw text -


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