Beta D 2.069.0-b1
ZombineDev via Digitalmars-d-announce
digitalmars-d-announce at puremagic.com
Wed Oct 14 06:02:45 PDT 2015
On Wednesday, 14 October 2015 at 11:54:22 UTC, Szymon Gatner
wrote:
> 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
C:\D\dmd2\windows\lib32mscoff\phobos32mscoff.lib "C:\Program
Files (x86)\Microsoft Visual Studio
14.0\VC\lib\legacy_stdio_definitions.lib"
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
14.0\VC\lib\amd64\legacy_stdio_definitions.lib"
Both works for me.
Anyway, I still don't think that forcing the users to use this
workaround is a great idea.
More information about the Digitalmars-d-announce
mailing list