Can't get D calling C to build.

div0 div0 at sourceforge.net
Fri Aug 20 10:44:38 PDT 2010


On 20/08/2010 09:17, Bob Cowdery wrote:
>
> I'm still concerned it's a bit too soon as a lot of things seem to be
> either Windows or Linux (cmake says its only tested for *nix) but not
> both and there is very little guidance on building. I really want to get
> this working on Windows first. As D makes so much of its binary
> compatibility with C I find it odd that there is no information on how
> to build mixed systems just on how to code the calls.

C compatibly is fine as long as you either build with dmc
or convert the VC c libs to dmc's format. The conversion tool is only 
available as part of the paid tool set off of digital mars I think; 
though possibly there's a free one around.

Try searching the learn archive it's been discussed before.

Personnaly I just compile stuff with dmc and it all works great as long 
as you get the extern c declarations right.

> dmc gives me this error:
> OPTLINK : Error 118: Filename Expected
> LIB="C:\D2.0\dm\bin\..\lib";"C:\D2.0\dm\bin\..\mfc\lib";C:\Program
> Files\Gtk+\lib
>
> The paths are correct as far as I can tell.
>

Optlink hates spaces in paths. It will also barf if you have spaces in 
any of the directories in the PATH environment var as well; you should 
setup an explicit PATH when running DMD.

If you really need stuff with spaces in the name, you can use junction 
to create symlinks on 'doze and put the sym links in your path instead:

http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx

-- 
My enormous talent is exceeded only by my outrageous laziness.
http://www.ssTk.co.uk


More information about the Digitalmars-d-learn mailing list