Re: Symbol undefined

2014-01-30 Thread Ali Çehreli

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



Re: Symbol undefined

2014-01-30 Thread Andrej Mitrovic

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.


Re: Symbol undefined

2014-01-30 Thread Andrej Mitrovic
On 1/30/14, Martijn Pot martijnpo...@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


Re: Symbol undefined

2014-01-30 Thread Andrej Mitrovic
On 1/30/14, Andrej Mitrovic andrej.mitrov...@gmail.com wrote:
 On 1/30/14, Martijn Pot martijnpo...@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.


Re: Symbol Undefined _D2rt12__ModuleInfoZ

2013-12-10 Thread Heinz
I always have the same problems (ModuleInfoZ, initZ, etc) when 
using import modules (.di files) wich i then have to include in 
the compilation process to get rid of linking errors. I do not 
know if this is the case.


Re: Symbol Undefined _D2rt12__ModuleInfoZ

2013-12-09 Thread Carl Sturtivant


My fault! and the reason is worth understanding in a slightly 
wider context.


I'm importing into the new memory management related D source 
files a D interface file obtained via htod and some tweaking from 
the C header files associated with the C source I am modifying. 
And that interface file, while perfectly correct and containing 
nothing that shouldn't be in a C header file (specifically, no 
function definitions) nevertheless needed to be compiled into an 
object and added to the eventual link. Doing so eliminated the 
problem entirely.


Symbol Undefined _D2rt12__ModuleInfoZ which I couldn't 
unmangle, meant that there was a missing module called rt. 
Presumably dmd put that symbol in the import section of the 
object that was made with 'import rt' in its source to bring in 
my interface file. Obvious from the symbol after the fact.


I was able to demangle the symbol in the following part of the 
error message,
Symbol Undefined 
_D2rt6b_real11__xopEqualsUKxS2rt6b_realKxS2rt6b_realZb. It's the 
mangled version of the following.


extern (C) bool rt.b_real.__xopEquals(ref const(rt.b_real), ref 
const(rt.b_real))


This lead me to understand that the message
Symbol Undefined _D2rt6b_real6__initZ appears to be about an 
initializer for the struct b_real that doesn't exist either.


Why optlink chose these particular missing symbols is somewhat 
puzzling, as there are perhaps 50 or so structs in rt. And I do 
not use an equality test with b_real in any way. I'd be curious 
to know, as it would be nice to have a better handle on 
decrypting the implications of error messages produced when 
linking a 32 bit windows program built with dmd fails.


Re: Symbol undefined due to import statement

2011-08-15 Thread torhu

On 15.08.2011 10:15, Andre wrote:
...

I compile the application with command:
dmd -IC:\Projects\Reusuable main.d

This works, but if I now edit the http.d file
and add an import statement like import std.stdio;
then the linker will output following error:

   main.obj(main)
   Error 42: Symbol Undefined _D3net4http12__ModuleInfoZ

Where is my error?


You need to add all your project's files to the command line:

dmd -IC:\Projects\Reusuable main.d net\http.d



Re: Symbol undefined due to import statement

2011-08-15 Thread Andre
Am Mon, 15 Aug 2011 10:24:38 +0200 schrieb torhu:

 dmd -IC:\Projects\Reusuable main.d net\http.d

Hi torhu,

thanks a lot. This works.

Kind regards
Andre


Re: Symbol undefined on interface with public getter and package setter

2009-02-23 Thread Ellery Newcomer

Daniel Keep wrote:


TSalm wrote:

I'm not sure but I think package is not virtual.

:-(
So there's really no way to have a method declared package in an
interface ?


You also can't have a private function in an interface.  This once lost
me four days trying to figure out why my program wouldn't link despite
the function very obviously being there.

Stick to public functions only.

  -- Daniel


Double thanks! I ran into this issue just a day or two ago.


Re: Symbol undefined on interface with public getter and package setter

2009-02-21 Thread TSalm
Le Sat, 21 Feb 2009 04:00:42 +0100, Daniel Keep  
daniel.keep.li...@gmail.com a écrit:





TSalm wrote:


I'm not sure but I think package is not virtual.


:-(
So there's really no way to have a method declared package in an
interface ?


You also can't have a private function in an interface.  This once lost
me four days trying to figure out why my program wouldn't link despite
the function very obviously being there.

Stick to public functions only.


What a pity :(

Thanks.


Re: Symbol undefined on interface with public getter and package setter

2009-02-20 Thread TSalm

It seems this comes only from the package method.

The error is the same with this code :
/* --- CODE --- */
interface I
{
   package void setFunc(int);
}


class A:I
{
  int i;

  package  void setFunc(int i)
  { this.i = i ; }

}


void main()
{

  I a = new A;
  a.setFunc = 10;

}
/* --- END CODE --- */


Hello,

When I compile the code below, I've got the following error :
  OPTLINK (R) for Win32  Release 8.00.1
  Copyright (C) Digital Mars 1989-2004  All rights reserved.
  private_method_in_interface_file3.obj(private_method_in_interface_file3)
   Error 42: Symbol Undefined  
_D33private_method_in_interface_file31I4funcMFiZv

  --- errorlevel 1


/* - CODE -- */
interface I
{
int func() ;
package void func(int);
}

class A:I
{
   int i;

   package  void func(int i)
   { this.i = i; }

   int func()
   { return i; }
}

void main()
{

   I a = new A ;
   a.func = 10 ;
   Stdout(a.func).newline ;

}
/* --- END CODE  */


Thanks in advance for your help,
TSalm




Re: Symbol undefined on interface with public getter and package setter

2009-02-20 Thread Jarrett Billingsley
On Fri, Feb 20, 2009 at 3:56 PM, Jacob Carlborg d...@me.com wrote:

 I'm not sure but I think package is not virtual.


The compiler should catch that then.


Re: Symbol undefined on interface with public getter and package setter

2009-02-20 Thread Jacob Carlborg

TSalm wrote:

Hello,

When I compile the code below, I've got the following error :
 OPTLINK (R) for Win32  Release 8.00.1
 Copyright (C) Digital Mars 1989-2004  All rights reserved.
 private_method_in_interface_file3.obj(private_method_in_interface_file3)
  Error 42: Symbol Undefined 
_D33private_method_in_interface_file31I4funcMFiZv

 --- errorlevel 1


/* - CODE -- */
interface I
{
   int func() ;
   package void func(int);
}

class A:I
{
  int i;

  package  void func(int i)
  { this.i = i; }

  int func()
  { return i; }
}

void main()
{

  I a = new A ;
  a.func = 10 ;
  Stdout(a.func).newline ;

}
/* --- END CODE  */


Thanks in advance for your help,
TSalm


I'm not sure but I think package is not virtual.


Re: Symbol undefined on interface with public getter and package setter

2009-02-20 Thread TSalm


I'm not sure but I think package is not virtual.


:-(
So there's really no way to have a method declared package in an  
interface ?




Re: Symbol undefined on interface with public getter and package setter

2009-02-20 Thread Daniel Keep


TSalm wrote:

 I'm not sure but I think package is not virtual.
 
 :-(
 So there's really no way to have a method declared package in an
 interface ?

You also can't have a private function in an interface.  This once lost
me four days trying to figure out why my program wouldn't link despite
the function very obviously being there.

Stick to public functions only.

  -- Daniel