From: Joseph Rose Newsgroups: comp.os.msdos.djgpp Subject: Re: Problems linking Date: Wed, 12 Apr 2000 04:53:37 -0400 Organization: Posted via Supernews, http://www.supernews.com Lines: 63 Message-ID: <38F43991.76768916@pop.gis.net> References: <38F3E260 DOT B762A9E AT pop DOT gis DOT 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 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com 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 > #include > #include > > /*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; > };