Mono-D icon indicating copy to clipboard operation
Mono-D copied to clipboard

Shared Library project doesn't compile on windows

Open dsoronda opened this issue 10 years ago • 2 comments

Using Xamarin Studio (5.7.2) + Mono-D (2.7.11). I created default Shared library project and tried to compile it.

This is Mono-d generated line :

dmd.exe -debug -gc "myclass.d"   "-L/IMPLIB:D:\work\d\SharedLibDemo\SharedLib\bin\Debug\SharedLib.lib" "-odobj\Debug" "-ofD:\work\d\SharedLibDemo\SharedLib\bin\Debug\SharedLib.dll" -w -vcolumns

I got this error:

OPTLINK (R) for Win32  Release 8.00.15
Copyright (C) Digital Mars 1989-2013  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
obj\Debug\SharedLib.obj(SharedLib)
 Error 42: Symbol Undefined _D14TypeInfo_Class6__vtblZ
obj\Debug\SharedLib.obj(SharedLib)
 Error 42: Symbol Undefined _D6object6Object5opCmpMFC6ObjectZi
obj\Debug\SharedLib.obj(SharedLib)
 Error 42: Symbol Undefined _D6object6Object8opEqualsMFC6ObjectZb
obj\Debug\SharedLib.obj(SharedLib)
 Error 42: Symbol Undefined __d_newclass
obj\Debug\SharedLib.obj(SharedLib)
 Error 42: Symbol Undefined _D6object6Object8toStringMFZAya
obj\Debug\SharedLib.obj(SharedLib)
 Error 42: Symbol Undefined _D6object6Object6toHashMFNbNeZk
obj\Debug\SharedLib.obj(SharedLib)
 Error 42: Symbol Undefined _D6Object7__ClassZ
--- errorlevel 7

It is possible that i'm missing something and also to comment that bin/Debug/SharedLib.dll is created in process.

dsoronda avatar Mar 11 '15 17:03 dsoronda

Those linker errors look as if the runtime isn't being linked in.

Orvid avatar Mar 21 '15 07:03 Orvid

Ah, right, as soon as you reference any library, the default phobos reference becomes discarded. Just add phobos.lib to the "Default Linked-in Libraries" in Mono-D's settings.

aBothe avatar Mar 21 '15 12:03 aBothe