www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Can't create dll

reply "Yaroslav" <rybalka.yaroslav gmail.com> writes:
I'm trying to create dll. It is template in mono-d plugin.
module myclass;

class MyClass
{
	//TODO: Enter class code here
}

export:
extern(D):

MyClass createMyClass()
{
	return new MyClass();
}

//////////////////

Build completed with errors.
Compiler output:
Building: dshared (Debug)
Performing main compilation...
Current dictionary: C:\Users\yrybalka\Documents\dshared\dshared
dmd.exe -debug -gc "myclass.d"  "-IC:\D\dmd2\src\phobos" 
"-L/IMPLIB:C:\Users\yrybalka\Documents\dshared\dshared\bin\Debug\dshared.lib" 
"-odobj\Debug" 
"-ofC:\Users\yrybalka\Documents\dshared\dshared\bin\Debug\dshared.dll"

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


And when I add void main(){}, all errors disappear. What I did 
wrong?

Windows 8.1 x64, dmd 2.064
Nov 16 2013
next sibling parent reply Ary Borenszweig <ary esperanto.org.ar> writes:
On 11/16/13 5:11 PM, Yaroslav wrote:
 I'm trying to create dll. It is template in mono-d plugin.
 module myclass;

 class MyClass
 {
      //TODO: Enter class code here
 }

 export:
 extern(D):

 MyClass createMyClass()
 {
      return new MyClass();
 }

 //////////////////

 Build completed with errors.
 Compiler output:
 Building: dshared (Debug)
 Performing main compilation...
 Current dictionary: C:\Users\yrybalka\Documents\dshared\dshared
 dmd.exe -debug -gc "myclass.d"  "-IC:\D\dmd2\src\phobos"
 "-L/IMPLIB:C:\Users\yrybalka\Documents\dshared\dshared\bin\Debug\dshared.lib"
 "-odobj\Debug"
 "-ofC:\Users\yrybalka\Documents\dshared\dshared\bin\Debug\dshared.dll"

 OPTLINK (R) for Win32  Release 8.00.13
Maybe also add -c: -c do not link
Nov 16 2013
parent "Yaroslav" <rybalka.yaroslav gmail.com> writes:
Yes, it works, thank you!
Nov 16 2013
prev sibling parent reply Ary Borenszweig <ary esperanto.org.ar> writes:
On 11/16/13 5:11 PM, Yaroslav wrote:
 I'm trying to create dll. It is template in mono-d plugin.
By the way, someone should *really* rename this list to "D.dev" or something similar, and put it at the bottom (or just put digitalmars.D.learn at the top top).
Nov 16 2013
parent reply John J <john.joyus gmail.com> writes:
On 11/16/2013 05:05 PM, Ary Borenszweig wrote:
 On 11/16/13 5:11 PM, Yaroslav wrote:
 I'm trying to create dll. It is template in mono-d plugin.
By the way, someone should *really* rename this list to "D.dev" or something similar, and put it at the bottom (or just put digitalmars.D.learn at the top top).
More than top or bottom, the name of the D newsgroup itself should indicate it's purpose. Something like "D.core" or "D.compilerdesign" etc., Then they would look for the more friendly and suitable names and quickly find the "D.learn" wherever it is in the list.
Nov 16 2013
parent "Nick" <nmsmith65 gmail.com> writes:
D.design seems like a clear and simple name to me, and the 
description should probably be changed from "General discussion 
of the D programming language." to "Discussion about the design 
and implementation of the D programming language."

On Sunday, 17 November 2013 at 05:03:33 UTC, John J wrote:
 On 11/16/2013 05:05 PM, Ary Borenszweig wrote:
 On 11/16/13 5:11 PM, Yaroslav wrote:
 I'm trying to create dll. It is template in mono-d plugin.
By the way, someone should *really* rename this list to "D.dev" or something similar, and put it at the bottom (or just put digitalmars.D.learn at the top top).
More than top or bottom, the name of the D newsgroup itself should indicate it's purpose. Something like "D.core" or "D.compilerdesign" etc., Then they would look for the more friendly and suitable names and quickly find the "D.learn" wherever it is in the list.
Nov 16 2013