Re: DMD Refuses to Compile Multiple Source Files

2017-03-07 Thread Samwise via Digitalmars-d-learn
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

Re: DMD Refuses to Compile Multiple Source Files

2017-01-18 Thread Samwise via Digitalmars-d-learn
Thanks loads. I got it working using those modules. ~Sam

Re: DMD Refuses to Compile Multiple Source Files

2017-01-18 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 18 January 2017 at 23:12:15 UTC, Mike Parker wrote: (source files), then use the import statement to make the declarations in other modules. Sorry, this should read "make the implementations available to other modules".

Re: DMD Refuses to Compile Multiple Source Files

2017-01-18 Thread Nicholas Wilson via Digitalmars-d-learn
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

Re: DMD Refuses to Compile Multiple Source Files

2017-01-18 Thread Samwise via Digitalmars-d-learn
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

Re: DMD Refuses to Compile Multiple Source Files

2017-01-17 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 18 January 2017 at 04:06:23 UTC, Samwise wrote: On Wednesday, 18 January 2017 at 03:51:50 UTC, ketmar wrote: On Wednesday, 18 January 2017 at 03:37:46 UTC, Samwise wrote: extern int getReturnCode() { return 4; } still does not compile using the command from above. I may

Re: DMD Refuses to Compile Multiple Source Files

2017-01-17 Thread ketmar via Digitalmars-d-learn
On Wednesday, 18 January 2017 at 04:06:23 UTC, Samwise wrote: I have both the header in hello.d and the actual function in getReturnCode.d as extern, and it still fails with the same error. nope. it works.

Re: DMD Refuses to Compile Multiple Source Files

2017-01-17 Thread Samwise via Digitalmars-d-learn
On Wednesday, 18 January 2017 at 03:51:50 UTC, ketmar wrote: On Wednesday, 18 January 2017 at 03:37:46 UTC, Samwise wrote: extern int getReturnCode() { return 4; } still does not compile using the command from above. I may very well be misunderstanding you though. yep. *both*

Re: DMD Refuses to Compile Multiple Source Files

2017-01-17 Thread ketmar via Digitalmars-d-learn
On Wednesday, 18 January 2017 at 03:37:46 UTC, Samwise wrote: extern int getReturnCode() { return 4; } still does not compile using the command from above. I may very well be misunderstanding you though. yep. *both* prototype and real declaration should be `extern(C)`. `(C)` part is

Re: DMD Refuses to Compile Multiple Source Files

2017-01-17 Thread Samwise via Digitalmars-d-learn
On Wednesday, 18 January 2017 at 03:25:47 UTC, Stefan Koch wrote: On Wednesday, 18 January 2017 at 03:11:08 UTC, Samwise wrote: On Wednesday, 18 January 2017 at 02:48:45 UTC, James Buren wrote: Import the source file containing the external function instead of writing that prototype. It should

Re: DMD Refuses to Compile Multiple Source Files

2017-01-17 Thread Stefan Koch via Digitalmars-d-learn
On Wednesday, 18 January 2017 at 03:11:08 UTC, Samwise wrote: On Wednesday, 18 January 2017 at 02:48:45 UTC, James Buren wrote: Import the source file containing the external function instead of writing that prototype. It should compile then. This seems like a workaround more than a permanent

Re: DMD Refuses to Compile Multiple Source Files

2017-01-17 Thread Samwise via Digitalmars-d-learn
On Wednesday, 18 January 2017 at 02:48:45 UTC, James Buren wrote: Import the source file containing the external function instead of writing that prototype. It should compile then. This seems like a workaround more than a permanent solution. It would work, but still. I'm also not sure about

Re: DMD Refuses to Compile Multiple Source Files

2017-01-17 Thread James Buren via Digitalmars-d-learn
Import the source file containing the external function instead of writing that prototype. It should compile then.

DMD Refuses to Compile Multiple Source Files

2017-01-17 Thread Samwise via Digitalmars-d-learn
Alright. For the sake of this argument, I'm going to post all the stuff about a really tiny boring program that quite literally does nothing, even though I found this issue when I was working with a much larger project with more functions. Basically I'm getting errors when I attempt to compile