DMD and C compatibility on Linux

Bob Cowdery bob at bobcowdery.plus.com
Sat Nov 27 15:07:41 PST 2010


On 27/11/2010 22:11, Jonathan M Davis wrote:
> On Saturday 27 November 2010 14:04:26 Bob Cowdery wrote:
>> I've just started to get organised to port my project from Windows to
>> Ubuntu. I see there is now a DMD for Linux which I have installed. My
>> question is can anyone tell me what I need to build the C libraries in
>> to be compatible. On Windows I had to use DMC or convert the libraries.
>> As there is no DMC on Linux will GNU GCC output link with DMD output?
> On windows, optlink is used by dmd to link binaries. optlink is the linker for 
> dmc. Since, you need compatible linkers for both the D and C code if you want 
> them to link together, you use dmc for your C code.
>
> On Linux, gcc is used to link by dmd to link binaries. So, the C code needs to 
> be linked by gcc. And since it pretty much already all is, you don't have to 
> worry about it. The situtation is much better than on Windows where there you're 
> more likely to be using Microsoft's compiler than dmc, and you have to adjust 
> what your doing to use dmc. On Linux, it should just work (as long you're 
> dealing with 32-bit libraries anyway; that can be a bit of a problem on 64-bit 
> machines, since the 64-bit port for dmd isn't complete yet, but generally all 
> you have to do is make sure that you have the 32-bit versions installed, and you 
> should be fine).
>
> - Jonathan M Davis
Thats good news. I stick to 32 bit as 64 bit still seems to be a hassle
for drivers etc. Thanks very much.

bob


More information about the Digitalmars-d-learn mailing list