DMD Refuses to Compile Multiple Source Files

Nicholas Wilson via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jan 18 14:36:05 PST 2017


On Wednesday, 18 January 2017 at 19:28:20 UTC, Samwise wrote:
> On Wednesday, 18 January 2017 at 04:25:42 UTC, Mike Parker 
> wrote:
>>
>> extern(C), not simply extern. It turns off the name mangling. 
>> But really, the proper thing to do is to drop the prototype 
>> and import the module with the implementation. It's tge way 
>> modules are intended to be used. Unless you're doing something 
>> specidic like writing a library that calls an arbitrary user 
>> function.
>
> Alright, so I misunderstood what ketmar was saying. His 
> solution did work. I'm just not sure I understand what you are 
> trying to say here:
>
>> But really, the proper thing to do is to drop the prototype 
>> and import the module with the implementation.
>
> This will still preserve my multiple source files, without 
> worrying about the headers, right? Thanks,
> ~Sam

Yes. Take a look at some random projects from code.dlang.org and 
look at the way they have laid out their modules and what they 
import and from where.


More information about the Digitalmars-d-learn mailing list