Required to link windows header modules (?)

Sean Kelly sean at f4.ca
Thu Jun 8 16:40:33 PDT 2006


Walter Bright wrote:
> 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)?
> 
> What link errors are you getting?

For example, if I modify the Phobos makefile by removing any reference 
to std.c.windows.windows, then rebuilding Phobos gives me this at the 
end.  It's essentially the same as the issues I've been having:


Digital Mars Librarian Version 8.00n
Copyright (C) Digital Mars 2000-2002 All Rights Reserved www.digitalmars.com
Digital Mars Librarian complete.

\bin\dmd\bin\dmd unittest -g
C:\bin\dmd\bin\..\..\dm\bin\link.exe unittest,,,user32+kernel32/co/noi;
OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

phobos.lib(date)
  Error 42: Symbol Undefined 
__init_3std1c7windows7windows21TIME_ZONE_INFORMATION

phobos.lib(file)
  Error 42: Symbol Undefined __init_3std1c7windows7windows16WIN32_FIND_DATAW
phobos.lib(file)
  Error 42: Symbol Undefined __init_3std1c7windows7windows15WIN32_FIND_DATA
phobos.lib(gcx)
  Error 42: Symbol Undefined __init_3std1c7windows7windows7CONTEXT
phobos.lib(syserror)
  Error 42: Symbol Undefined _MAKELANGID at 8
--- errorlevel 5

--- errorlevel 5

C:\bin\dmd\src\phobos>



More information about the Digitalmars-d-bugs mailing list