www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Strange DSSS/Tango compile error

reply Robert Kosek <robert.kosek thewickedflea.com> writes:
Hi all,

I'm writing a very simplistic RPG in D to learn the language, and my 
Dice structure seems to have some kind of problem.  All it does it wraps 
dice rolls into a reusable wrapper.

Only, the compile is completely botched! Here's what happens:

 g> dsss build dice.d rpg.d
 dice.d => dice
 + C:\utils\dmd\dsss\bin\rebuild.exe -Idsss_imports\ -I. -S.\
-IC:\utils\dmd\dsss
 \include\d -SC:\utils\dmd\dsss\lib\  -IC:\utils\dmd\dsss\include\d
-SC:\utils\dm
 d\dsss\lib  -oqdsss_objs\D  dice.d -ofdice
 OPTLINK (R) for Win32  Release 8.00.1
 Copyright (C) Digital Mars 1989-2004  All rights reserved.
 dsss_objs\D\rpg-dice.obj(rpg-dice)
  Error 42: Symbol Undefined _D10ModuleInfo6__vtblZ
 dsss_objs\D\tango-math-Random.obj(tango-math-Random)
  Error 42: Symbol Undefined _D9invariant12_d_invariantFC6ObjectZv
 dsss_objs\D\tango-math-Random.obj(tango-math-Random)
  Error 42: Symbol Undefined __d_newclass
 dsss_objs\D\tango-math-Random.obj(tango-math-Random)
  Error 42: Symbol Undefined _D6object6Object8opEqualsMFC6ObjectZi
 dsss_objs\D\tango-math-Random.obj(tango-math-Random)
  Error 42: Symbol Undefined _D6object6Object5opCmpMFC6ObjectZi
 dsss_objs\D\tango-math-Random.obj(tango-math-Random)
  Error 42: Symbol Undefined _D6object6Object6toHashMFZk
 dsss_objs\D\tango-math-Random.obj(tango-math-Random)
  Error 42: Symbol Undefined _D6object6Object8toStringMFZAa
 dsss_objs\D\tango-math-Random.obj(tango-math-Random)
  Error 42: Symbol Undefined _D6Object7__ClassZ
 dsss_objs\D\tango-math-Random.obj(tango-math-Random)
  Error 42: Symbol Undefined _D9ClassInfo6__vtblZ
 OPTLINK : Warning 134: No Start Address
 --- errorlevel 9
 Command C:\utils\dmd\dsss\bin\rebuild.exe returned with code -1, aborting.
 Error: Command failed, aborting.
I get these errors whether I include tango.math.Rand or tango.math.Random. I am using the latest copy of Easy D (http://www.fsdev.net/versions/show/1) with DMD 1.030 and Tango 0.99.7; I haven't used the other parts yet. I've included the source so you can check it out yourself, just in case I made an error. It's nothing special, and I'm getting no other errors any longer. Thanks in advance for any help you might have. Robert
Oct 15 2008
parent reply "Jarrett Billingsley" <jarrett.billingsley gmail.com> writes:
On Wed, Oct 15, 2008 at 11:11 AM, Robert Kosek
<robert.kosek thewickedflea.com> wrote:
 Hi all,

 I'm writing a very simplistic RPG in D to learn the language, and my Dice
 structure seems to have some kind of problem.  All it does it wraps dice
 rolls into a reusable wrapper.

 Only, the compile is completely botched! Here's what happens:

 g> dsss build dice.d rpg.d
 dice.d => dice
 + C:\utils\dmd\dsss\bin\rebuild.exe -Idsss_imports\ -I. -S.\
 -IC:\utils\dmd\dsss
 \include\d -SC:\utils\dmd\dsss\lib\  -IC:\utils\dmd\dsss\include\d
 -SC:\utils\dm
 d\dsss\lib  -oqdsss_objs\D  dice.d -ofdice
 OPTLINK (R) for Win32  Release 8.00.1
 Copyright (C) Digital Mars 1989-2004  All rights reserved.
 dsss_objs\D\rpg-dice.obj(rpg-dice)
  Error 42: Symbol Undefined _D10ModuleInfo6__vtblZ
 dsss_objs\D\tango-math-Random.obj(tango-math-Random)
  Error 42: Symbol Undefined _D9invariant12_d_invariantFC6ObjectZv
 dsss_objs\D\tango-math-Random.obj(tango-math-Random)
  Error 42: Symbol Undefined __d_newclass
 dsss_objs\D\tango-math-Random.obj(tango-math-Random)
  Error 42: Symbol Undefined _D6object6Object8opEqualsMFC6ObjectZi
 dsss_objs\D\tango-math-Random.obj(tango-math-Random)
  Error 42: Symbol Undefined _D6object6Object5opCmpMFC6ObjectZi
 dsss_objs\D\tango-math-Random.obj(tango-math-Random)
  Error 42: Symbol Undefined _D6object6Object6toHashMFZk
 dsss_objs\D\tango-math-Random.obj(tango-math-Random)
  Error 42: Symbol Undefined _D6object6Object8toStringMFZAa
 dsss_objs\D\tango-math-Random.obj(tango-math-Random)
  Error 42: Symbol Undefined _D6Object7__ClassZ
 dsss_objs\D\tango-math-Random.obj(tango-math-Random)
  Error 42: Symbol Undefined _D9ClassInfo6__vtblZ
 OPTLINK : Warning 134: No Start Address
 --- errorlevel 9
 Command C:\utils\dmd\dsss\bin\rebuild.exe returned with code -1, aborting.
 Error: Command failed, aborting.
I get these errors whether I include tango.math.Rand or tango.math.Random. I am using the latest copy of Easy D (http://www.fsdev.net/versions/show/1) with DMD 1.030 and Tango 0.99.7; I haven't used the other parts yet. I've included the source so you can check it out yourself, just in case I made an error. It's nothing special, and I'm getting no other errors any longer. Thanks in advance for any help you might have. Robert
It just looks like it's not linking in the Tango libraries. I thought EasyD would have done that for you.
Oct 15 2008
parent reply Robert Kosek <robert.kosek thewickedflea.com> writes:
Jarrett Billingsley wrote:
 It just looks like it's not linking in the Tango libraries.  I thought
 EasyD would have done that for you.
That's the odd part, it usually does! In fact, the above command line arguments are what are always executed (beyond my specifying which files to build). Here's the thing: if I remove a reference to my rpg.dice module (in dice.d in the same directory) it compiles and links Tango. Thus I think it's not linking *my* code rather than Tango. I think Tango is linking just fine. (Perhaps my private import is the problem?) This compiles:
 module rpg;
 
 import tango.io.Stdout/*, rpg.dice*/;
 
 void main() {
    /* Dice d = {4,6};
     Stdout.format("Dice roll is(4d6): {}", d.roll());*/
     Stdout("This is a test!").newline.flush;
 }
But to uncomment the pieces for the dice rolling, and my linking dies immediately. What should I do for a project that uses multiple files for its compilation? Should I have any special file system structure within the directory, or should I add a special search path to the build? Thanks, Robert
Oct 15 2008
parent reply "Jarrett Billingsley" <jarrett.billingsley gmail.com> writes:
On Wed, Oct 15, 2008 at 2:13 PM, Robert Kosek
<robert.kosek thewickedflea.com> wrote:
 Jarrett Billingsley wrote:
 It just looks like it's not linking in the Tango libraries.  I thought
 EasyD would have done that for you.
That's the odd part, it usually does! In fact, the above command line arguments are what are always executed (beyond my specifying which files to build). Here's the thing: if I remove a reference to my rpg.dice module (in dice.d in the same directory) it compiles and links Tango. Thus I think it's not linking *my* code rather than Tango. I think Tango is linking just fine. (Perhaps my private import is the problem?) This compiles:
 module rpg;

 import tango.io.Stdout/*, rpg.dice*/;

 void main() {
   /* Dice d = {4,6};
    Stdout.format("Dice roll is(4d6): {}", d.roll());*/
    Stdout("This is a test!").newline.flush;
 }
But to uncomment the pieces for the dice rolling, and my linking dies immediately. What should I do for a project that uses multiple files for its compilation? Should I have any special file system structure within the directory, or should I add a special search path to the build? Thanks, Robert
Oh, I just realized what it is, I think. Don't build dice.d, dsss will build it for you automatically. Just do "dsss build rpg.d" and it'll automatically compile and link rpg as well as any dependent modules. I think it's trying to compile dice.d as a program, which of course won't work.
Oct 15 2008
parent reply Robert Kosek <robert.kosek thewickedflea.com> writes:
Jarrett Billingsley wrote:
 Oh, I just realized what it is, I think.  Don't build dice.d, dsss
 will build it for you automatically.  Just do "dsss build rpg.d" and
 it'll automatically compile and link rpg as well as any dependent
 modules.  I think it's trying to compile dice.d as a program, which of
 course won't work.
Hmm, that's an interesting idea. However, if I do that I get the following error:
 dsss build rpg.d
 rpg.d => rpg
 + C:\utils\dmd\dsss\bin\rebuild.exe -Idsss_imports\ -I. -S.\
-IC:\utils\dmd\dsss
 \include\d -SC:\utils\dmd\dsss\lib\  -IC:\utils\dmd\dsss\include\d
-SC:\utils\dm
 d\dsss\lib  -oqdsss_objs\D  rpg.d -ofrpg
 Command C:\utils\dmd\dsss\bin\rebuild.exe returned with code 1, aborting.
 Error: Command failed, aborting.
Which I have absolutely no idea what means, nor how to go about fixing it. Thanks for all your help so far. I hope we can figure this out soon. Regards, Robert
Oct 15 2008
parent reply Sergey Gromov <snake.scaly gmail.com> writes:
Wed, 15 Oct 2008 16:24:42 -0400,
Robert Kosek wrote:
 Jarrett Billingsley wrote:
 Oh, I just realized what it is, I think.  Don't build dice.d, dsss
 will build it for you automatically.  Just do "dsss build rpg.d" and
 it'll automatically compile and link rpg as well as any dependent
 modules.  I think it's trying to compile dice.d as a program, which of
 course won't work.
Hmm, that's an interesting idea. However, if I do that I get the following error:
 dsss build rpg.d
 rpg.d => rpg
 + C:\utils\dmd\dsss\bin\rebuild.exe -Idsss_imports\ -I. -S.\
-IC:\utils\dmd\dsss
 \include\d -SC:\utils\dmd\dsss\lib\  -IC:\utils\dmd\dsss\include\d
-SC:\utils\dm
 d\dsss\lib  -oqdsss_objs\D  rpg.d -ofrpg
 Command C:\utils\dmd\dsss\bin\rebuild.exe returned with code 1, aborting.
 Error: Command failed, aborting.
Which I have absolutely no idea what means, nor how to go about fixing it.
May I recommend you to try 'bud' ? http://dsource.org/projects/build It's a single executable, pretty similar to 'rebuild' and can be used like this: bud rpg.d I've had weird problems with rebuild recently.
Oct 15 2008
next sibling parent "Bill Baxter" <wbaxter gmail.com> writes:
On Thu, Oct 16, 2008 at 6:13 AM, Sergey Gromov <snake.scaly gmail.com> wrote:
 Wed, 15 Oct 2008 16:24:42 -0400,
 Robert Kosek wrote:
 Jarrett Billingsley wrote:
 Oh, I just realized what it is, I think.  Don't build dice.d, dsss
 will build it for you automatically.  Just do "dsss build rpg.d" and
 it'll automatically compile and link rpg as well as any dependent
 modules.  I think it's trying to compile dice.d as a program, which of
 course won't work.
Hmm, that's an interesting idea. However, if I do that I get the following error:
 dsss build rpg.d
 rpg.d => rpg
 + C:\utils\dmd\dsss\bin\rebuild.exe -Idsss_imports\ -I. -S.\
-IC:\utils\dmd\dsss
 \include\d -SC:\utils\dmd\dsss\lib\  -IC:\utils\dmd\dsss\include\d
-SC:\utils\dm
 d\dsss\lib  -oqdsss_objs\D  rpg.d -ofrpg
 Command C:\utils\dmd\dsss\bin\rebuild.exe returned with code 1, aborting.
 Error: Command failed, aborting.
Which I have absolutely no idea what means, nor how to go about fixing it.
May I recommend you to try 'bud' ? http://dsource.org/projects/build It's a single executable, pretty similar to 'rebuild' and can be used like this: bud rpg.d I've had weird problems with rebuild recently.
The most recent release of DSSS/rebuild takes a long long time to build programs. There's definitely something not quite right about it. I've gone back to the previous version of DSSS (0.76pre is what I have actually). --bb
Oct 15 2008
prev sibling parent reply Robert Kosek <robert.kosek thewickedflea.com> writes:
Sergey Gromov wrote:
 May I recommend you to try 'bud' ?
 http://dsource.org/projects/build
 
 It's a single executable, pretty similar to 'rebuild' and can be used 
 like this:
 
 bud rpg.d
 
 I've had weird problems with rebuild recently.
Thanks for the recommendation. That, plus one other thing, fixed my whole problem. Thanks a bunch! I'll definitely be using Bud from now on. ;-) Thanks, Robert
Oct 15 2008
next sibling parent "Jarrett Billingsley" <jarrett.billingsley gmail.com> writes:
On Wed, Oct 15, 2008 at 5:54 PM, Robert Kosek
<robert.kosek thewickedflea.com> wrote:
 Sergey Gromov wrote:
 May I recommend you to try 'bud' ?
 http://dsource.org/projects/build

 It's a single executable, pretty similar to 'rebuild' and can be used like
 this:

 bud rpg.d

 I've had weird problems with rebuild recently.
Thanks for the recommendation. That, plus one other thing, fixed my whole problem. Thanks a bunch! I'll definitely be using Bud from now on. ;-)
Keep in mind, though, that Bud is ancient and the author has, I believe, stated that he is no longer interested in maintaining it. There are undoubtedly times when it will break.
Oct 15 2008
prev sibling parent reply "Bill Baxter" <wbaxter gmail.com> writes:
On Thu, Oct 16, 2008 at 7:30 AM, Jarrett Billingsley
<jarrett.billingsley gmail.com> wrote:
 On Wed, Oct 15, 2008 at 5:54 PM, Robert Kosek
 <robert.kosek thewickedflea.com> wrote:
 Sergey Gromov wrote:
 May I recommend you to try 'bud' ?
 http://dsource.org/projects/build

 It's a single executable, pretty similar to 'rebuild' and can be used like
 this:

 bud rpg.d

 I've had weird problems with rebuild recently.
Thanks for the recommendation. That, plus one other thing, fixed my whole problem. Thanks a bunch! I'll definitely be using Bud from now on. ;-)
Keep in mind, though, that Bud is ancient and the author has, I believe, stated that he is no longer interested in maintaining it. There are undoubtedly times when it will break.
Well, part right. It is ancient, but the author has stated on a number of occasions in the not too distant past that a new version would be released "next week". But the author has also said most recently that he has no interest D1 any more and D2 changes too fast. So I'm not sure where that leaves Bud. On the other hand the author of DSSS has said he won't have much time for it either, now that he's in grad school. And he hasn't responded to questions about the speed issues with the most recent DSSS release. So... I think maybe it's a difficult choice between the two build tools right now. May be a good time to give SCONS a look. :-) --bb
Oct 15 2008
next sibling parent reply "Chris R. Miller" <lordsauronthegreat gmail.com> writes:
Bill Baxter wrote:
 On Thu, Oct 16, 2008 at 7:30 AM, Jarrett Billingsley
 <jarrett.billingsley gmail.com> wrote:
 On Wed, Oct 15, 2008 at 5:54 PM, Robert Kosek
 <robert.kosek thewickedflea.com> wrote:
 Sergey Gromov wrote:
 May I recommend you to try 'bud' ?
 http://dsource.org/projects/build

 It's a single executable, pretty similar to 'rebuild' and can be used like
 this:

 bud rpg.d

 I've had weird problems with rebuild recently.
Thanks for the recommendation. That, plus one other thing, fixed my whole problem. Thanks a bunch! I'll definitely be using Bud from now on. ;-)
Keep in mind, though, that Bud is ancient and the author has, I believe, stated that he is no longer interested in maintaining it. There are undoubtedly times when it will break.
Well, part right. It is ancient, but the author has stated on a number of occasions in the not too distant past that a new version would be released "next week". But the author has also said most recently that he has no interest D1 any more and D2 changes too fast. So I'm not sure where that leaves Bud. On the other hand the author of DSSS has said he won't have much time for it either, now that he's in grad school. And he hasn't responded to questions about the speed issues with the most recent DSSS release. So... I think maybe it's a difficult choice between the two build tools right now. May be a good time to give SCONS a look. :-)
Or learn how to write makefiles... yuk!
Oct 15 2008
parent reply Mike Parker <aldacron gmail.com> writes:
Chris R. Miller wrote:
 Bill Baxter wrote:
 On Thu, Oct 16, 2008 at 7:30 AM, Jarrett Billingsley
 <jarrett.billingsley gmail.com> wrote:
 On Wed, Oct 15, 2008 at 5:54 PM, Robert Kosek
 <robert.kosek thewickedflea.com> wrote:
 Sergey Gromov wrote:
 May I recommend you to try 'bud' ?
 http://dsource.org/projects/build

 It's a single executable, pretty similar to 'rebuild' and can be 
 used like
 this:

 bud rpg.d

 I've had weird problems with rebuild recently.
Thanks for the recommendation. That, plus one other thing, fixed my whole problem. Thanks a bunch! I'll definitely be using Bud from now on. ;-)
Keep in mind, though, that Bud is ancient and the author has, I believe, stated that he is no longer interested in maintaining it. There are undoubtedly times when it will break.
Well, part right. It is ancient, but the author has stated on a number of occasions in the not too distant past that a new version would be released "next week". But the author has also said most recently that he has no interest D1 any more and D2 changes too fast. So I'm not sure where that leaves Bud. On the other hand the author of DSSS has said he won't have much time for it either, now that he's in grad school. And he hasn't responded to questions about the speed issues with the most recent DSSS release. So... I think maybe it's a difficult choice between the two build tools right now. May be a good time to give SCONS a look. :-)
Or learn how to write makefiles... yuk!
Or maybe some enterprising soul could modify PreMake[1] to generate Makefiles compatible with Digital Mars make (which would be useful for any C/C++/D app using DM* compilers). [1] http://premake.sourceforge.net/
Oct 15 2008
parent "Chris R. Miller" <lordsauronthegreat gmail.com> writes:
Mike Parker wrote:
 Chris R. Miller wrote:
 Bill Baxter wrote:
 On Thu, Oct 16, 2008 at 7:30 AM, Jarrett Billingsley
 <jarrett.billingsley gmail.com> wrote:
 On Wed, Oct 15, 2008 at 5:54 PM, Robert Kosek
 <robert.kosek thewickedflea.com> wrote:
 Sergey Gromov wrote:
 May I recommend you to try 'bud' ?
 http://dsource.org/projects/build

 It's a single executable, pretty similar to 'rebuild' and can be 
 used like
 this:

 bud rpg.d

 I've had weird problems with rebuild recently.
Thanks for the recommendation. That, plus one other thing, fixed my whole problem. Thanks a bunch! I'll definitely be using Bud from now on. ;-)
Keep in mind, though, that Bud is ancient and the author has, I believe, stated that he is no longer interested in maintaining it. There are undoubtedly times when it will break.
Well, part right. It is ancient, but the author has stated on a number of occasions in the not too distant past that a new version would be released "next week". But the author has also said most recently that he has no interest D1 any more and D2 changes too fast. So I'm not sure where that leaves Bud. On the other hand the author of DSSS has said he won't have much time for it either, now that he's in grad school. And he hasn't responded to questions about the speed issues with the most recent DSSS release. So... I think maybe it's a difficult choice between the two build tools right now. May be a good time to give SCONS a look. :-)
Or learn how to write makefiles... yuk!
Or maybe some enterprising soul could modify PreMake[1] to generate Makefiles compatible with Digital Mars make (which would be useful for any C/C++/D app using DM* compilers). [1] http://premake.sourceforge.net/
Hmm, in the mean time, I did run across an interesting (and delightfully terse) make tutorial a while back: http://mrbook.org/tutorials/make/ The final example file at the end is most useful.
Oct 15 2008
prev sibling parent =?UTF-8?B?QWxleGFuZGVyIFDDoW5law==?= writes:
Bill Baxter wrote:
 On the other hand the author of DSSS has said he won't have much time
 for it either, now that he's in grad school.  And he hasn't responded
 to questions about the speed issues with the most recent DSSS release.
I try to help out Gregor the best I can, though I can not promise to solve all problems, known or unknown, of both, Rebuild and DSSS. But, I can look into it and make Gregor solve it, *somehow*. Maybe when we bribe him with enough Moxie.
Oct 15 2008