rdmd and extern(C)

Nick Sabalausky a at a.a
Thu Dec 23 10:40:42 PST 2010


"Nick Sabalausky" <a at a.a> wrote in message 
news:if04me$1vpa$1 at digitalmars.com...
> "Andrei Alexandrescu" <SeeWebsiteForEmail at erdani.org> wrote in message 
> news:ievlbg$elu$2 at digitalmars.com...
>> On 12/23/10 12:31 AM, Nick Sabalausky wrote:
>>> "Andrei Alexandrescu"<SeeWebsiteForEmail at erdani.org>  wrote in message
>>> news:iethab$2dj9$1 at digitalmars.com...
>>>> On 12/22/10 12:13 PM, spir wrote:
>>>>> Hello,
>>>>>
>>>>> Is it possible use rdmd (to automagically link against imported D
>>>>> modules), when also calling C funcs? I tried to add the C file at the 
>>>>> end
>>>>> of the building command, like eg (removed all dmd options):
>>>>> rdmd --build-only -ofmyProg myProg.d myCFuncs.o
>>>>> but rdmd does not seem to transmit additional files to link against to
>>>>> dmd. (In addition to the ones guessed from imports.)
>>>>>
>>>>> [Also, we would be glad to get some feedback when rdmd fails: 
>>>>> currently
>>>>> it ends silently. (At the very minimum: "Failed to compile/link." At
>>>>> best, some more accurate messages such as "Cannot find imported module
>>>>> 'foo.d'.")]
>>>>>
>>>>
>>>> Looks like a good enhancement for rdmd. That it doesn't "fail
>>>> successfully" is a bug.
>>>>
>>>
>>> @spir: rdmd's command-line syntax is like this:
>>>
>>> rdmd {args to dmd and rdmd} app.d {args sent to app.exe}
>>>
>>> So anything after the first *.d param is automatically considered a 
>>> param
>>> for when rdmd runs the app your building, not for rdmd/dmd. Of course, 
>>> if
>>> you're using --build-only, then such params just simply get ignored. In
>>> short, you have to do it like this:
>>>
>>> rdmd --build-only -ofmyProg myCFuncs.o myProg.d
>>>
>>> Unfortunately, that still doesn't work with the official version of 
>>> rdmd.
>>> However...
>>>
>>> @Andrei: I submitted an rdmd patch for this not too long ago:
>>>
>>> http://d.puremagic.com/issues/show_bug.cgi?id=4928
>>>
>>> It fixes this problem for object files, static library files, ".def" 
>>> files
>>> and response files.
>>
>> Thanks! Did you test on all OSs?
>>
>
> All that I have access to. Which is two: WinXP and Kubuntu (both x86, 
> 32-bit).
>

I have some other rdmd patches in bugzilla too. A bugzilla search on "rdmd" 
will find them all.




More information about the Digitalmars-d mailing list