Linking with C on Windows

2014-06-05 Thread Mark Isaacson via Digitalmars-d-learn
I'm having a very difficult time figuring out exactly how to do this. I've compiled my D code into a .obj file with dmd, but I don't know what C compiler I should use (or if it makes any difference). I've attempted to use MinGW gcc, which spits out .o files, and Visual Studio, which does...

Re: Linking with C on Windows

2014-06-05 Thread bearophile via Digitalmars-d-learn
Mark Isaacson: My attempts to have either the MinGW linker or the Visual Studio linker accept my D .objs have all failed. Try using the dmc compiler for the C code. Bye, bearophile

Re: Linking with C on Windows

2014-06-05 Thread Mark Isaacson via Digitalmars-d-learn
On Thursday, 5 June 2014 at 22:59:48 UTC, bearophile wrote: Mark Isaacson: My attempts to have either the MinGW linker or the Visual Studio linker accept my D .objs have all failed. Try using the dmc compiler for the C code. Bye, bearophile I'd considered that, but in the long term that

Re: Linking with C on Windows

2014-06-05 Thread Mark Isaacson via Digitalmars-d-learn
Still unresolved, but a thought: I decided to take a step back and try to link with C on Linux first. I found out that if I did the linking step with dmd things worked, but not with gcc. The reason then became apparent: dmd knows to pass druntime and phobos and all of that stuff to the linker.

Re: Linking with C on Windows

2014-06-05 Thread Ellery Newcomer via Digitalmars-d-learn
On Thursday, 5 June 2014 at 23:12:56 UTC, Mark Isaacson wrote: I need to eventually be able to export a dll that can talk with anything. how would using dmc conflict with this goal? dmd/dmc output omf object files, windows infrastructure is all coff object files. linux/mingw/etc are..