aBothe / Mono-D

D Add-In for MonoDevelop
http://wiki.dlang.org/Mono-D
Other
113 stars 26 forks source link

Shared Library project doesn't compile on windows #589

Open dsoronda opened 9 years ago

dsoronda commented 9 years ago

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.

Orvid commented 9 years ago

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

aBothe commented 9 years ago

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.