Thread overview
Symbol undefined
Jan 30, 2014
Martijn Pot
Jan 30, 2014
Andrej Mitrovic
Jan 30, 2014
Martijn Pot
Jan 30, 2014
Andrej Mitrovic
Jan 30, 2014
Andrej Mitrovic
Jan 30, 2014
Ali Çehreli
January 30, 2014
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?
January 30, 2014
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.
January 30, 2014
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

January 30, 2014
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.

January 30, 2014
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
January 30, 2014
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.