cairo(D) / x64 / unresolved externals / don't know why

Robert M. Münch via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jan 11 09:27:13 PST 2016


On 2016-01-11 06:53:51 +0000, Benjamin Thaut said:

> You should not need to link manually against msvcrt, dmd does this for you.

Ok, that was what I expected.

> You can view the linker commands that are stored inside a object file 
> via microsoft dumpbin tool "dumpbin /DIRECTIVES your.obj".

Great, thanks for this.

> You should check the declarations of the functions that cause a 
> unresolved external error. If they have a "export" in front of them, 
> remove the export. I can not think of any other reason why dmd would 
> otherwise reference a import symbol.

Ah, good point. I didn't see the link to the DLL import stuff. I can't 
/ shouldn't remove them because these are coming from <math.h> It looks 
like my project is mixing up static and dynamic linked runtime libs.

> Import symbols are symbols used for dll linking and start with "__imp_"

Is this a DMD convention or a general one? Never heard about this.

> Out of curiosity, why do you pass "-m64" 6 times to dmd? Once would be enough.

I don't have a clue where these come from. I just use DUB to compile my 
D project.

> For debug builds targeting windows 64 I would also highly recommend 
> using "-gc -op" instead of "-g". This will give a much better debugging 
> experience in Visual Studio.

Ok, will see how to get this in. Thanks so far for all the hints.

-- 
Robert M. Münch
http://www.saphirion.com
smarter | better | faster



More information about the Digitalmars-d-learn mailing list