atilaneves / dpp

Directly include C headers in D source code
Boost Software License 1.0
231 stars 31 forks source link

Fix Windows #285

Closed aminya closed 3 years ago

aminya commented 3 years ago

Addresses https://github.com/atilaneves/dpp/issues/182#issuecomment-845557514

adamdruppe commented 3 years ago

so that other linker error you saw is just optlink related so if the compiler is dmd, you need to specify either -m32mscoff OR -m64. not both, not neither. so i guess xor lol.

but i'd say if args doesn't include -m64, just add -m32mscoff

aminya commented 3 years ago

This is ready now. I tested it on Windows by building a large C library, and I can confirm that now it works with dmd if I use --mscrtlib=msvcrtd. I put it behind an option, but this can be the default behavior.

d++ --mscrtlib=msvcrtd  #....other things
aminya commented 3 years ago

Edit: fixed in #287

I don't know why this irrelevant change somehow causes the Linux tests to fail in the CI! It works locally for me: image

Edit: This also happens on the master branch, so it is not related to this PR.