www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - gdcwin for linking with Visual Studio libs?

reply Bill Baxter <dnewsgroup billbaxter.com> writes:
If I understand it correctly, dmd and gdc cannot link with MSVC C libs 
because of different object file formats, right?

But can I link MSVC code with D code if I use the MinGW gcc d compiler 
(gdcwin)?  From what I understand a MinGW .o can just be renamed .obj 
and a MinGW .a to .lib and it'll link using MSVC.

Has anyone tried such things?  The gdcwin page 
(http://gdcwin.sourceforge.net) doesn't say much about the topic.

--bb
Oct 16 2006
next sibling parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Bill Baxter wrote:

 Has anyone tried such things?  The gdcwin page 
 (http://gdcwin.sourceforge.net) doesn't say much about the topic.

I'll be happy to add the info, if you find it out :-) --anders
Oct 17 2006
next sibling parent Bill Baxter <dnewsgroup billbaxter.com> writes:
Anders F Björklund wrote:
 Bill Baxter wrote:
 
 Has anyone tried such things?  The gdcwin page 
 (http://gdcwin.sourceforge.net) doesn't say much about the topic.

I'll be happy to add the info, if you find it out :-) --anders

Ok. Sure thing. --bb
Oct 17 2006
prev sibling parent reply Bill Baxter <wbaxter gmail.com> writes:
Anders F Björklund wrote:
 Bill Baxter wrote:
 
 Has anyone tried such things?  The gdcwin page 
 (http://gdcwin.sourceforge.net) doesn't say much about the topic.

I'll be happy to add the info, if you find it out :-) --anders

What's the difference between gdcwin and the mingw pagckage on the dgcc site? And then there's the one you can get from the cygwin installer. Is that the same as dgcc's mingw package? --bb
Oct 17 2006
parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Bill Baxter wrote:

 What's the difference between gdcwin and the mingw pagckage on the dgcc 
 site? 

None whatsoever, is the idea... Just that I started doing binary packages (with installers), before GDC had moved to the new home and provided them too. I think the only difference now is the format: .tbz vs .exe ? (I created it using the Nullsoft Scriptable Install System)
 And then there's the one you can get from the cygwin installer. 

I think that's a much older GDC version, but I haven't checked: http://cygwin.com/packages/gcc-gdc/ Note here that Cygwin and MinGW are not exactly the same thing.
 Is that the same as dgcc's mingw package?

Unfortunately I'm not 100% aware of the options that David used to create the MinGW builds of GDC, on the dgcc page. :-( But for my own builds (gdcwin), I used the very same options (+ D language) as the other GCC packages available for MinGW: http://osdn.dl.sourceforge.net/mingw/gcc-3.4.2-build.sh http://osdn.dl.sourceforge.net/mingw/gcc-3.4.5-build.sh However, I changed the languages to: --enable-languages=c,c++,d Should have posted this information on the site long ago, sorry. --anders
Oct 17 2006
parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
 Unfortunately I'm not 100% aware of the options that David
 used to create the MinGW builds of GDC, on the dgcc page. :-(

Regarding: http://prdownloads.sourceforge.net/dgcc/gdc-0.19-mingw.tar.bz2 It says "3.4.5 (mingw special) (gdc 0.19, using dmd 0.162)", so I think it is built from MinGW GCC 3.4.5-20060117-1 too ? BTW: I'm planning to do an "experimental" build of GCC 4.0.3 for MinGW, as it seems that all patches have been included upstream ? Originally I had planned to do this with GDC 0.20, but now I have no idea when/if this will be released ? (ditto with MinGW GCC 4.0) So for now it would have to use the "unstable" SVN version of GDC, and include the C/C++ compilers for GCC as well as the D compiler. Not planning to do any builds for Cygwin (gdcwin) or Darwin (gdcmac), since the aim is to be as close to the MinGW/Xcode GCC as possible. --anders
Oct 17 2006
parent reply Bill Baxter <dnewsgroup billbaxter.com> writes:
Anders F Björklund wrote:
 Unfortunately I'm not 100% aware of the options that David
 used to create the MinGW builds of GDC, on the dgcc page. :-(

Regarding: http://prdownloads.sourceforge.net/dgcc/gdc-0.19-mingw.tar.bz2 It says "3.4.5 (mingw special) (gdc 0.19, using dmd 0.162)", so I think it is built from MinGW GCC 3.4.5-20060117-1 too ? BTW: I'm planning to do an "experimental" build of GCC 4.0.3 for MinGW, as it seems that all patches have been included upstream ? Originally I had planned to do this with GDC 0.20, but now I have no idea when/if this will be released ? (ditto with MinGW GCC 4.0) So for now it would have to use the "unstable" SVN version of GDC, and include the C/C++ compilers for GCC as well as the D compiler. Not planning to do any builds for Cygwin (gdcwin) or Darwin (gdcmac), since the aim is to be as close to the MinGW/Xcode GCC as possible.

Uh, I don't know much about MinGW/GCC. Should I be excited about all that? ---bb
Oct 17 2006
parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Bill Baxter wrote:

 Originally I had planned to do this with GDC 0.20, but now I have
 no idea when/if this will be released ? (ditto with MinGW GCC 4.0)

 So for now it would have to use the "unstable" SVN version of GDC,
 and include the C/C++ compilers for GCC as well as the D compiler.

Uh, I don't know much about MinGW/GCC. Should I be excited about all that?

If you wish :-) GDC SVN is up to about DMD 166, if that's any help ? --anders
Oct 17 2006
prev sibling parent Don Clugston <dac nospam.com.au> writes:
Bill Baxter wrote:
 If I understand it correctly, dmd and gdc cannot link with MSVC C libs 
 because of different object file formats, right?
 
 But can I link MSVC code with D code if I use the MinGW gcc d compiler 
 (gdcwin)?  From what I understand a MinGW .o can just be renamed .obj 
 and a MinGW .a to .lib and it'll link using MSVC.

Correct. Both gcc and MSVC use COFF format lib files; DMD uses OMF. You can use Walter's COFF2OMF tool to convert COFF to OMF, though. Nothing works with C++, though, since the name mangling isn't standardised.
 
 Has anyone tried such things?  The gdcwin page 
 (http://gdcwin.sourceforge.net) doesn't say much about the topic.
 
 --bb

Oct 17 2006