buggins / dlangui

Cross Platform GUI for D programming language
Boost Software License 1.0
805 stars 120 forks source link

Fixed ole32.dll pragrma for cross-compilation #650

Closed drahosj closed 1 year ago

drahosj commented 1 year ago

Pragma specified Ole32.dll, which broke compilation on case-sensitive file systems, ie. when cross-compiling with ldc on Linux.

Example of the error:

lld-link: error: could not open 'Ole32.lib': No such file or directory Error: /usr/bin/lld-link failed with status: 1 /usr/bin/ldc2 failed with exit code 1.

This fix brings dlangui in line with other packages which pragma(lib) ole32.

GrimMaple commented 1 year ago

Hi! Do you know what this code does or why it needs ole32 in the first place? It feels like using pragma is wrong in the first place. Maybe it sohuld be moved outsude, into the dub file?

drahosj commented 1 year ago

The pragma is in a version(Windows) block, so it looks like an old way of implementing version-specific linker flags, and it can be moved to dub.

I tested adding ole32 to libs-windows and removing the pragma; the library is still properly forwarded to the linker and it cross-compiles successfully; the linker arguments are equivalent whether using a pragma or dub.json.

FreeSlave commented 1 year ago

Hi! Do you know what this code does or why it needs ole32 in the first place?

ole32.dll is for CoInitialize, used when retrieving user's bookmarks