August 23, 2010 Re: Can't get D calling C to build. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bob Cowdery | Bob Cowdery Wrote:
> Thanks, that's an honest opinion. The first project I have in mind is a personal one but it's quite large. My hope would be to move a lot of the C code into D eventually. I don't think I would risk it on a commercial project until the toolchain is sorted and its a bit more mature.
You can try to port it now. You have htod and some level of source compatibility with C.
|
August 23, 2010 Re: Can't get D calling C to build. | ||||
---|---|---|---|---|
| ||||
On 22/08/2010 22:16, Bob Cowdery wrote:
> On 22/08/2010 20:57, bearophile wrote:
>> Bob Cowdery:
>>> Well, the link still works but the download is 0 bytes so I guess its not available. Thanks for the thought.
>> That links works for me :-)
>> Be happy, bye,
>> bearophile
> Works if I paste it but not straight from the email,odd.
Does the tool work for you. If I just build the default GCC DLL and then try to convert the import library it says it's not an import library.
bob
|
August 23, 2010 Re: Can't get D calling C to build. | ||||
---|---|---|---|---|
| ||||
On 23/08/2010 20:24, Bob Cowdery wrote:
> On 22/08/2010 22:16, Bob Cowdery wrote:
>> On 22/08/2010 20:57, bearophile wrote:
>>> Bob Cowdery:
>>>> Well, the link still works but the download is 0 bytes so I guess its not available. Thanks for the thought.
>>> That links works for me :-)
>>> Be happy, bye,
>>> bearophile
>> Works if I paste it but not straight from the email,odd.
> Does the tool work for you. If I just build the default GCC DLL and then try to convert the import library it says it's not an import library.
>
> bob
Addendum: The plot thickens. If I build a dll with my VC++ Express 2010 then I can convert the import library and it actually works from D. However if I build with MinGW GCC it doesn't even recognise the library even though it is COFF format. My preferred route unfortunately is GCC. I just got 'The D Programming Language' book and that devotes a whole half page to this very important topic. This seems to be rather a minefield and so far there only seems to be one route through it.
bob
|
August 23, 2010 Re: Can't get D calling C to build. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bob Cowdery | I haven't read the specifics of your problem yet, but have you tried using the newer TDM port of MinGW? The MinGW binaries are still using an older port of GCC, but the TDM version is much newer, so it might be worth trying it out. Get it from here: http://tdm-gcc.tdragon.net/ Hope that helps. Bob Cowdery Wrote: > On 23/08/2010 20:24, Bob Cowdery wrote: > > On 22/08/2010 22:16, Bob Cowdery wrote: > >> On 22/08/2010 20:57, bearophile wrote: > >>> Bob Cowdery: > >>>> Well, the link still works but the download is 0 bytes so I guess its not available. Thanks for the thought. > >>> That links works for me :-) > >>> Be happy, bye, > >>> bearophile > >> Works if I paste it but not straight from the email,odd. > > Does the tool work for you. If I just build the default GCC DLL and then try to convert the import library it says it's not an import library. > > > > bob > Addendum: The plot thickens. If I build a dll with my VC++ Express 2010 then I can convert the import library and it actually works from D. However if I build with MinGW GCC it doesn't even recognise the library even though it is COFF format. My preferred route unfortunately is GCC. I just got 'The D Programming Language' book and that devotes a whole half page to this very important topic. This seems to be rather a minefield and so far there only seems to be one route through it. > > bob |
August 23, 2010 Re: Can't get D calling C to build. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | Andrej Mitrovic: > I haven't read the specifics of your problem yet, but have you tried using the newer TDM port of MinGW? The MinGW binaries are still using an older port of GCC, but the TDM version is much newer, so it might be worth trying it out. > Get it from here: http://tdm-gcc.tdragon.net/ > Hope that helps. I like this, and I love the way you install it, this is the way a compiler has to be installed: http://nuwen.net/mingw.html Bye, bearophile |
August 23, 2010 Re: Can't get D calling C to build. | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | > I like this, and I love the way you install it, this is the way a compiler has to be installed: http://nuwen.net/mingw.html
Uhm... The last version (6.6 that is gcc 4.5.1) seems to produce very large binaries, and the precedent version seems not available. Not good for you.
Bye and sorry,
bearophile
|
August 24, 2010 Re: Can't get D calling C to build. | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | On 23/08/2010 23:04, bearophile wrote:
> Andrej Mitrovic:
>
>> I haven't read the specifics of your problem yet, but have you tried using the newer TDM port of MinGW? The MinGW binaries are still using an older port of GCC, but the TDM version is much newer, so it might be worth trying it out.
>> Get it from here: http://tdm-gcc.tdragon.net/
>> Hope that helps.
> I like this, and I love the way you install it, this is the way a compiler has to be installed: http://nuwen.net/mingw.html
>
> Bye,
> bearophile
Thanks for the suggestions. I wound back a bit and looked at the 3rd party libraries I was using and what do you know, they were all dll's with import libs. I don't know what compiler some were built with but they all converted with the coffimplib tool. So I rebuilt all my stuff with dmc and after a bit of faffing around with link errors I got the whole thing to build with a D front end that just makes a top level call to initialise everything. It correctly reported it couldn't open a usb device so it looks like it made its way down through several libraries to the hardware without choking. I might be on my way :-) .
bob
|
August 26, 2010 Re: Can't get D calling C to build. | ||||
---|---|---|---|---|
| ||||
Attachments:
| On Tue, Aug 24, 2010 at 15:24, Bob Cowdery <bob@bobcowdery.plus.com> wrote:
> I might be on my way :-) .
>
> Good :) I just skimmed through the thread, so I don't know if you're still
using Code::Blocks.
I'm using it, and it highlights D code with no problem. For 10.05, it's in
Settings > Editor > Syntax Highlighting > syntax highlighting for D (default
color scheme)
The keyword list might need to be updated a bit, maybe. I don't know if the
original install has 'immutable' as a keyword, for example.
Philippe
|
August 26, 2010 Re: Can't get D calling C to build. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Philippe Sigaud | CB uses the Scintilla editing component, which is the one used by Scite (which I'm using atm). Scite was missing quite a bit of keywords, so I've added some of them.
I just did a comparison, and it seems they're both missing a bunch of keywords. A fun thing to do is open CB and Scite side-by-side, and paste all the keywords from both and see which ones are highlighted.
I've fused the two together and removed duplicates (I also have string highlighted which you might want to remove). So the list goes:
property abstract alias align asm assert auto body bool break byte case cast catch cdouble cent cfloat char class const continue creal dchar dstring debug default delegate delete deprecated do double else enum export extern false final finally float for foreach foreach_reverse function goto idouble if ifloat immutable import in inout int interface invariant ireal is lazy long macro mixin module new nothrow null out override package pragma private protected public pure real ref return scope shared short size_t static string struct super switch synchronized template this throw true try typedef typeid typeof ubyte ucent uint ulong union unittest ushort version void volatile wchar wstring while with __FILE__ __LINE__ __gshared __thread __traits const_cast dynamic_cast explicit friend inline mutable namespace operator register reinterpret_cast restrict signed sizeof static_cast typename unsigned using virtual int8_t uint8_t int16_t uint16_t int32_t uint32_t int64_t uint64_t int_least8_t uint_least8_t int_least16_t uint_least16_t int_least32_t uint_least32_t int_least64_t uint_least64_t int_fast8_t uint_fast8_t int_fast16_t uint_fast16_t int_fast32_t uint_fast32_t int_fast64_t uint_fast64_t intptr_t uintptr_t intmax_t uintmax_t wint_t wchar_t wctrans_t wctype_t time_t and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq complex imaginary _Complex _Imaginary _Bool _Pragma
Philippe Sigaud Wrote:
> using Code::Blocks.
> I'm using it, and it highlights D code with no problem. For 10.05, it's in
> Settings > Editor > Syntax Highlighting > syntax highlighting for D (default
> color scheme)
> The keyword list might need to be updated a bit, maybe. I don't know if the
> original install has 'immutable' as a keyword, for example.
>
> Philippe
|
August 27, 2010 Re: Can't get D calling C to build. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bob Cowdery | On 23.08.2010 23:24, Bob Cowdery wrote: > Addendum: The plot thickens. If I build a dll with my VC++ Express 2010 > then I can convert the import library and it actually works from D. > However if I build with MinGW GCC it doesn't even recognise the library > even though it is COFF format. My preferred route unfortunately is GCC. > I just got 'The D Programming Language' book and that devotes a whole > half page to this very important topic. This seems to be rather a > minefield and so far there only seems to be one route through it. If you've got a DLL, you can usually generate an import library directly from that using the implib tool, download link below. ftp://ftp.digitalmars.com/bup.zip This obviously fails for DLLs that only export by ordinal, but those are not that common. You need to use the /s switch to get correct name mangling. |
Copyright © 1999-2021 by the D Language Foundation