On Wednesday, 14 October 2015 at 11:54:22 UTC, Szymon Gatner
On Wednesday, 14 October 2015 at 11:46:27 UTC, ZombineDev wrote:
2) How can I workaround the problem that _minfo* and _deh* are
not generated because my main is in C++?
Just add a file with int main() in D library to fix this.
Thanks! I didn't realize that I could add an empty main in D and
force the linker to use the C++ main just by ordering the
arguments to the linker :D
For 32-bit under VS2015 x86 Native Tools Command Prompt:
dmd -lib -m32mscoff my_d_lib.d
cl main.cpp my_d_lib.lib
Files (x86)\Microsoft Visual Studio
And for 64-bit under VS2015 x64 Native Tools Command Prompt:
dmd -lib -m64 my_d_lib.d
cl main.cpp my_d_lib.lib C:\D\dmd2\windows\lib64\phobos64.lib
"C:\Program Files (x86)\Microsoft Visual Studio
Both works for me.
Anyway, I still don't think that forcing the users to use this
workaround is a great idea.