Thread overview
Tango, usergdi32 problem, link prob i think..
Mar 12, 2007
Chris Warwick
Mar 13, 2007
Sean Kelly
Mar 13, 2007
Chris Warwick
March 12, 2007
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@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.

And thanks everyone who's been helping me, its very much apreciated,

cw





March 13, 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@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
March 13, 2007
"Sean Kelly" <sean@f4.ca> wrote in message news:et551e$8n7$1@digitalmars.com...
> 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@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.

Yeah that has done the trick.. thanks.