www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Symbol undefined

reply "Martijn Pot" <martijnpot52 gmail.com> writes:
I'm starting to use D out of curiousity. I've used both Eclipse + 
DDT and Visual Studio + visualD and both give the same error in 
my second test program (second to Hello World of course...) using 
the Transmogrifier/CardboardBox example from TDPL :

  Error 42: Symbol Undefined 
_D1a14Transmogrifier12transmogrifyMFZv (void 
a.Transmogrifier.transmogrify())

Am I not linking module a (containing Transmogrifier and 
CardboardBox)? How can I get either or both IDE's running my test 
program?
Jan 30 2014
next sibling parent reply "Andrej Mitrovic" <andrej.mitrovich gmail.com> writes:
On Thursday, 30 January 2014 at 21:28:08 UTC, Martijn Pot wrote:
  Error 42: Symbol Undefined 
 _D1a14Transmogrifier12transmogrifyMFZv (void 
 a.Transmogrifier.transmogrify())
Typically that means the function isn't implemented, e.g. this: void transmogrify(); instead of this: void transmogrify() { } The NVI examples in TDPL don't really work, as private functions in D are currently not virtual. You could try pasting example code of what you're trying to build to show you exactly what goes wrong.
Jan 30 2014
parent reply "Martijn Pot" <martijnpot52 gmail.com> writes:
On Thursday, 30 January 2014 at 21:33:05 UTC, Andrej Mitrovic 
wrote:
 On Thursday, 30 January 2014 at 21:28:08 UTC, Martijn Pot wrote:
 Error 42: Symbol Undefined 
 _D1a14Transmogrifier12transmogrifyMFZv (void 
 a.Transmogrifier.transmogrify())
Typically that means the function isn't implemented, e.g. this: void transmogrify(); instead of this: void transmogrify() { } The NVI examples in TDPL don't really work, as private functions in D are currently not virtual.
Indeed, making them public solved the problem. Is there more stuff in the book that isn't working?
 You could try pasting example code of what you're trying to 
 build to show you exactly what goes wrong.
Jan 30 2014
next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 1/30/14, Martijn Pot <martijnpot52 gmail.com> wrote:
 Indeed, making them public solved the problem. Is there more
 stuff in the book that isn't working?
Check the errata page[1], which coincidentally seems to be down. I'll CC Andrei. [1]: http://erdani.com/tdpl/errata/index.php?title=Main_Page Another more-recent book (and a free one) is this: http://ddili.org/ders/d.en/index.html
Jan 30 2014
prev sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 1/30/14, Andrej Mitrovic <andrej.mitrovich gmail.com> wrote:
 On 1/30/14, Martijn Pot <martijnpot52 gmail.com> wrote:
 Indeed, making them public solved the problem. Is there more
 stuff in the book that isn't working?
Check the errata page[1], which coincidentally seems to be down. I'll CC Andrei. [1]: http://erdani.com/tdpl/errata/index.php?title=Main_Page Another more-recent book (and a free one) is this: http://ddili.org/ders/d.en/index.html
I CC'ed the wrong address, re-sending.
Jan 30 2014
prev sibling parent =?UTF-8?B?QWxpIMOHZWhyZWxp?= <acehreli yahoo.com> writes:
On 01/30/2014 01:28 PM, Martijn Pot wrote:
 I'm starting to use D out of curiousity. I've used both Eclipse + DDT
 and Visual Studio + visualD and both give the same error in my second
 test program (second to Hello World of course...) using the
 Transmogrifier/CardboardBox example from TDPL :

   Error 42: Symbol Undefined _D1a14Transmogrifier12transmogrifyMFZv
 (void a.Transmogrifier.transmogrify())

 Am I not linking module a (containing Transmogrifier and CardboardBox)?
 How can I get either or both IDE's running my test program?
You must include a.d on the build line. dmd a.d main.d ... Ali
Jan 30 2014