Tango, usergdi32 problem, link prob i think..

Sean Kelly sean at f4.ca
Mon Mar 12 20:15:58 PDT 2007


Chris Warwick wrote:
> Hi. i've installed tango but i'd been strugling to get the sys.win32 stuff 
> happening. I keep getting this error when i build...
> 
> C:\Documents and Settings\chris\Desktop\dproj>bud Project1.d -full
> OPTLINK (R) for Win32  Release 7.50B1
> Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
> 
> cjl\graphic.obj(graphic)
>  Error 42: Symbol Undefined _SetDIBitsToDevice at 48
> 
> The source line is this..
> 
>         int err = SetDIBitsToDevice(
>             dc, x, y, fwidth, fheight,0, 0, 0,
>             fheight, fpixels.ptr, &fheader, DIB_RGB_COLORS
>             );
> 
> And it seems to do the same with all the gdi functions. Anyway I tried 
> this..
> 
> version(build) { pragma(link, usergdi32); };
> 
> to get bud to link in usergdi32, but CreateWindowEx, and other non gdi 
> functions are working ok so i dont think thats the problem.

usergdi32.lib is linked by default for Tango/Win32, so something else is 
going on.  I'd guess that perhaps the windows library that contains the 
implementation for this function is snot being linked.  The function 
lives in gdi32.lib, so try putting that in the pragma instead.  Tango's 
usergdi32.lib only contains constants and such.  The actual windows code 
lives elsewhere.


Sean


More information about the Digitalmars-d-learn mailing list