Conditional Compilation for Specific Windows

Jacob Carlborg via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jan 7 23:41:52 PST 2015


On 2015-01-07 20:48, Jonathan Marler wrote:

> I've looked up the windows version helper functions
> (http://msdn.microsoft.com/en-us/library/windows/desktop/dn424972(v=vs.85).aspx).
>   The problem is that these functions are not defined in DMD's
> user32.lib.  I could use the operating system's user32.lib but it is in
> COFF format, so I would have to convert my D object files to COFF and
> then compile using MSVC or GNU GCC for windows (or I could try
> converting the OS user32.lib to OMF).  Or, I could add the functions to
> DMD's user32.lib but as far as I know this is a private binary managed
> by Digital Mars that I can't contribute to?  Am I wrong?  Does anyone
> else have a solution or an idea on this?
>
> Note: I've wanted to use other windows function in the past that were
> missing from DMD's user32.lib file.  A solution to solve this for
> multiple functions would be ideal, thanks.

You can either:

1. Convert an up to date user32.lib to OMF
2. Create your own user32.lib from the DLL
3. Compile using the COFF format and use the Visual Studio runtime 
instead. This has been recently added (I'm not sure if it's released 
yet) and requires using a flag

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list