Required to link windows header modules (?)

Sean Kelly sean at f4.ca
Thu Jun 8 16:28:06 PDT 2006


Sean Kelly wrote:
> The standard C headers I've defined don't need to be linked against my 
> app in any circumstances I've encountered so far--they serve as pure 
> import modules.  However, I've recently discovered that this does not 
> hold true for the Windows headers I use, which seem to require me to 
> link against them if I reference any struct they declare.  Is it 
> possible that extern (C) declarations tell the compiler that the struct 
> will be available elsewhere and extern (Windows) doesn't?  It's worth 
> noting that the link errors I get display a D-style mangled name for the 
> struct definitions rather than a C-style name as I'd expect.  Should 
> these structs all be declared as extern (C)?

By the way, I ask this because the executable size increases by a 
minimum of 500 bytes for every module included, even if they contain 
just declarations.  The full Windows header set being what it is (thanks 
to Don and crew's efforts), this means more than a 50K increase in 
program size just for a "hello world" application if Build actually 
links all the Windows headers referenced.


Sean



More information about the Digitalmars-d-bugs mailing list