Mail Archives: djgpp/2000/04/11/22:10:37
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 -