Mail Archives: djgpp/2000/04/12/08:40:53
I used the default options, except I played around with the "-ansi" (I
turned it back off.) and one or two other C compiler options
("-fallow-float") and the nasm options (ended up with conditional-assembly
options selected via -D and otherwise the defaults). I tried treating the
library as a library; I changed the output, include and sources directories
to the directory containing the library and test code, and as far as I
remember, the other options are cosmetic.
BTW, can I set a custom text mode in DJGPP? I found the options, but
"other" seems to get the last screen mode selected
.
Joseph Rose wrote:
> 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 -