-
Notifications
You must be signed in to change notification settings - Fork 3
Updating Libraries
The libraries shipping with DMD can be much older than needed. At the time of writing examples require this updated.
For COM programming the two most common libraries are Ole32.lib and OleAut32.lib. These can be found in dmd/windows/lib and will need to be updated.
DMD 32bit uses the OMF library format, Microsoft has moved to COFF. This creates an incompatibility when trying to link with third party libraries. Thus dmd will package its own versions of common Windows libraries.
First is downloading the needed files to get us started.
- ftp://ftp.digitalmars.com/coffimplib.zip
- Windows SDK or Visual Studio
Windows 8 they no longer package the required libraries with the SDK. Instead you must install a version of Visual Studio. Also your Path will also be a different location
- C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x86
After a nice long Windows SDK install (or Visual Studio). Several COFF libraries will be made available, default: C:\Program Files\Microsoft SDKs\Windows\v6.0\Lib (where version can change; may also be under (x86)).
Run coffimplib on the two files
PS D:\src\juno> coffimplib.exe 'C:\Program Files\Microsoft SDKs\Windows\v6.0\Lib\OleAut32.Lib' OleAut32.lib
PS D:\src\juno> coffimplib.exe 'C:\Program Files\Microsoft SDKs\Windows\v6.0\Lib\Ole32.Lib' Ole32.lib
PS D:\src\juno> coffimplib.exe 'C:\Program Files\Microsoft SDKs\Windows\v6.0\Lib\Crypt32.Lib' Crypt32.lib
PS D:\src\juno> coffimplib.exe 'C:\Program Files\Microsoft SDKs\Windows\v6.0\Lib\Gdiplus.Lib' gdiplus.lib
Then place these files in your dmd/windows/lib directory. Or they can remain local to your compilation.
If an error similar to this arises, as it has for me, I found that renaming the lib with something as unscary as: OleAut32.Lib.dum will do the trick. If you don't ask I won't tell. Actually asking won't help.