linking trouble

Mike Parker aldacron at gmail.com
Fri Sep 7 04:14:31 UTC 2018


On Friday, 7 September 2018 at 02:44:24 UTC, hridyansh thakur 
wrote:
> On Thursday, 6 September 2018 at 16:59:43 UTC, rikki cattermole 
> wrote:
>> On 07/09/2018 4:03 AM, hridyansh thakur wrote:
>>> [...]
>>
>> That definition isn't complete. Missing at the very least 
>> ``();`` to make it a function declaration.
>>
>>> [...]
>>
>> So what is the errors you're getting?
>> And what are the commands you're executing?
>
> compiler is failing to rercognise the .o file

A .o file? Are you using MinGW to compile your C++? You're not 
going to get very far if you are. You have two options that are 
guaranteed to work.

Use the Digital Mars C++ compiler to compile your C++ file to an 
OMF object then use the default OPTLINK linker when building. 
This only supports 32-bit builds.

dmd foo.d bar.obj

The other option is to use the Microsoft linker, which requires 
the MS build tools be installed, either via the build tools 
distribution or Visual Studio. Then you can compile your C++ file 
to a COFF object with the MS compiler for 32- or 64-bit and build 
your executable with one of the following:

dmd -m32mscoff foo.d bar.obj
dmd -m64 foo.d bar.obj


More information about the Digitalmars-d-learn mailing list