May 17, 2005
...And yes the problem was very frustrating.  It had me occupied almost all night trying to figure out what was going on...

-JJR
May 17, 2005
Thomas Kuehne wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> David Medlock wrote:
> | Russ Lewis wrote:
> |
> |> David Medlock wrote:
> |>
> |>> Walter, I _IMPLORE_ you to clean up the error messages.
> |>>
> |>> In the meantime can someone please help to decode what the following
> |>> gibberish means?  I don't have an init() method for the class
> |>> SectorCache (nor its TypeInfo???) so I am pretty stumped here.
> |>>
> |>> E:\proj\d\game\obj\bmp.obj(bmp)
> |>>  Error 42: Symbol Undefined
> |>> _D3std6stream4File5_ctorFAaE3std6stream8FileModeZC3std6stream4File
> |>> E:\proj\d\game\obj\world.obj(world)
> |>>  Error 42: Symbol Undefined __init_30TypeInfo_PC5world11SectorCache
> |>> E:\proj\d\game\obj\world.obj(world)
> |>>  Error 42: Symbol Undefined
> |>> __init_51TypeInfo_C5clist27CList_PC5world11SectorCache5CList
> |>> --- errorlevel 3
> 
> <snip>
> 
> results on linux:
> 
> ./dmd -version=Test a.d
> gcc a.o -o a -lphobos -lpthread -lm -Xlinker -L/opt/digitalmars/122/dmd/lib
> /usr/bin/ld: Warning: size of symbol
> `_D3std6stdarg8va_arg_i6va_argFKPvZi' changed from 18 in a.o to 21 in
> /opt/digitalmars/122/dmd/lib/libphobos.a(format.o)
> /usr/bin/ld: Warning: size of symbol
> `_D3std6stdarg9va_arg_Aa6va_argFKPvZAa' changed from 23 in a.o to 34 in
> /opt/digitalmars/122/dmd/lib/libphobos.a(format.o)
> 
> ./a
> Count is 3
> A Item= 300
> A Item= 200
> A Item= 100
> B Item= 200
> B Item= 300
> B Item= 400
> B Item= 500
> B Item= 600
> C Item= 300
> C Item= 200
> C Item= 100
> C Item= 200
> C Item= 300
> C Item= 400
> C Item= 500
> found 200 in C, 200 = next
> ~ S : Hello
> ~ S : World
> ~ S : !
> ~ S2 : Hello
> ~ S2 : Cruel
> ~ S2 : World
> ~ S2 : !
> ~ S2 Reversed : !
> ~ S2 Reversed : World
> ~ S2 Reversed : Cruel
> ~ S2 Reversed : Hello
> 
> Thomas
> -----BEGIN PGP SIGNATURE-----
> 
> iD8DBQFCihes3w+/yD4P9tIRAh9hAJwJnFIuhU+ybEomWlWvobLd37lmKACgyxu6
> tkrnnZ+GxpZ4FKV6t3Hq6NQ=
> =eCtJ
> -----END PGP SIGNATURE-----

CList in and of itself isnt the problem. Its using CList with another class(SectorCache).

Like I said I commented out all of SectorCache class members and the error persists.  Of course putting CList and SectorCache in a simple file alone does not generate the error.

I can send you the project if you want to peruse it but the bottom line is the error message makes no sense whatsoever.  I could probably fix this on my own if I had some clue what was happening.

-DavidM
May 17, 2005
John Reimer wrote:

> David Medlock wrote:
> 
>> Thomas Kuehne wrote:
>>
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>>
>>> David Medlock schrieb am Tue, 17 May 2005 09:51:03 -0400:
>>>
>>>> Ben Hinkle wrote:
>>>>
>>>>
>>>>> "David Medlock" <noone@nowhere.com> wrote in message news:d6cqao$1b7t$1@digitaldaemon.com...
>>>>>
>>>>>
>>>>>> Walter, I _IMPLORE_ you to clean up the error messages.
>>>>>>
>>>>>> In the meantime can someone please help to decode what the following gibberish means?  I don't have an init() method for the class SectorCache (nor its TypeInfo???) so I am pretty stumped here.
>>>>>>
>>>>>> E:\proj\d\game\obj\bmp.obj(bmp)
>>>>>> Error 42: Symbol Undefined _D3std6stream4File5_ctorFAaE3std6stream8FileModeZC3std6stream4File
>>>>>> E:\proj\d\game\obj\world.obj(world)
>>>>>> Error 42: Symbol Undefined __init_30TypeInfo_PC5world11SectorCache
>>>>>> E:\proj\d\game\obj\world.obj(world)
>>>>>> Error 42: Symbol Undefined __init_51TypeInfo_C5clist27CList_PC5world11SectorCache5CList
>>>>>> --- errorlevel 3
>>>>>
>>>>>
>>>>>
>>>>> Try deleting all the obj files and recompiling cleanly. Also it seems odd that std.stream symbols can't be found so I'd check your phobos version or path to phobos or something. But first I'd to a clean rebuild to see if the problem is crufty obj files.
>>>>
>>>>
>>>>
>>>> Dmanager has a full build option, so I had tried that.  I just deleted them by hand and retried with the same results.
>>>
>>>
>>>
>>>
>>> Can you wipe up a simple file that uses std.stream.File and
>>> std.stream.FileMode ?
>>>
>>> Note: Those messages aren't produced by dmd but by the linker.
>>>
>>> Thomas
>>>
>>
>> Actually the file stream issue was due to a mis-copy of the link command into a command window.
>>
>> Only the following two errors are the issue:
>>
>> E:\proj\d\game\obj\world.obj(world)
>>  Error 42: Symbol Undefined __init_29TypeInfo_C5world11SectorCache
>> E:\proj\d\game\obj\world.obj(world)
>>  Error 42: Symbol Undefined __init_50TypeInfo_C5clist26CList_C5world11SectorCache5CList
>> --- errorlevel 2
>>
>> I went ahead and commented out all the members and methods of SectorCache, did a full build, and still the error remains.
>>
>> The only line I can remove from my project to eliminate the error is
>>
>> alias CList!(SectorCache) CacheList;
>>
>> -DavidM
> 
> 
> Heh... This looks like a similar error to the one I just finished experiencing.  I noted it in the digitalmars.d newsgroup.
> 
> See "Hair-pulling, D, and Optlink"
> 
> Walter explains the problem of having a template-only-containing object file inserted into a library.  You don't appear to be using a lib file here... but perhaps the problem is related?
> 
> -JJR


I just read Walter's reply in that thread, and I am not sure I fully understand.

If I use:

alias  CList!(SectorCache)	CacheList;

Then explicitly link in 'clist.obj' it should be linked in with the exe no matter what.  Why would the _type_ above be removed? There are no duplicates of it anywhere.  Even if I replace the line with

class CacheList : CList!(SectorCache) {}

it still does not link!

Walter, little gotchas like this can really doom D.  Whether or not its fast, simple, garbage collected, etc doesn't matter if legal constructs within the language will not compile or link.  I am not trying to trivialize the technical issue, but I am emphasizing the usability issue here.

-DavidM

May 17, 2005
David Medlock wrote:
> John Reimer wrote:

>> Heh... This looks like a similar error to the one I just finished experiencing.  I noted it in the digitalmars.d newsgroup.
>>
>> See "Hair-pulling, D, and Optlink"
>>
>> Walter explains the problem of having a template-only-containing object file inserted into a library.  You don't appear to be using a lib file here... but perhaps the problem is related?
>>
>> -JJR
> 
> 
> 
> I just read Walter's reply in that thread, and I am not sure I fully understand.
> 
> If I use:
> 
> alias  CList!(SectorCache)    CacheList;
> 
> Then explicitly link in 'clist.obj' it should be linked in with the exe no matter what.  Why would the _type_ above be removed? There are no duplicates of it anywhere.  Even if I replace the line with
> 
> class CacheList : CList!(SectorCache) {}
> 
> it still does not link!
> 
> Walter, little gotchas like this can really doom D.  Whether or not its fast, simple, garbage collected, etc doesn't matter if legal constructs within the language will not compile or link.  I am not trying to trivialize the technical issue, but I am emphasizing the usability issue here.
> 
> -DavidM
> 

Well... true. It may not be the same issue then.  This problem should not surface with a single object file.  I wasn't sure how you were linking things in or where that particular object was.  It's only likely to happen if this object file resides in a library.

I'm afraid I don't understand what's going on here.

-JJR
May 17, 2005
David Medlock wrote:

> 
> I just read Walter's reply in that thread, and I am not sure I fully understand.
> 
> If I use:
> 
> alias  CList!(SectorCache)    CacheList;
> 
> Then explicitly link in 'clist.obj' it should be linked in with the exe no matter what.  Why would the _type_ above be removed? There are no duplicates of it anywhere.  Even if I replace the line with
> 
> class CacheList : CList!(SectorCache) {}
> 
> it still does not link!
> 
> Walter, little gotchas like this can really doom D.  Whether or not its fast, simple, garbage collected, etc doesn't matter if legal constructs within the language will not compile or link.  I am not trying to trivialize the technical issue, but I am emphasizing the usability issue here.
> 
> -DavidM
> 

Just out of curiosity, maybe you can try Walter's trick... it can't hurt trying.

1) add "int foo;" to the bottom of the clist.d file.
2) add "int* pfoo = &clist.foo" to one of the files that uses the CList template (any one that imports it).

See if you can link again.

-JJR
May 17, 2005
John Reimer wrote:
> David Medlock wrote:
> 
>>
>> I just read Walter's reply in that thread, and I am not sure I fully understand.
>>
>> If I use:
>>
>> alias  CList!(SectorCache)    CacheList;
>>
>> Then explicitly link in 'clist.obj' it should be linked in with the exe no matter what.  Why would the _type_ above be removed? There are no duplicates of it anywhere.  Even if I replace the line with
>>
>> class CacheList : CList!(SectorCache) {}
>>
>> it still does not link!
>>
>> Walter, little gotchas like this can really doom D.  Whether or not its fast, simple, garbage collected, etc doesn't matter if legal constructs within the language will not compile or link.  I am not trying to trivialize the technical issue, but I am emphasizing the usability issue here.
>>
>> -DavidM
>>
> 
> Just out of curiosity, maybe you can try Walter's trick... it can't hurt trying.
> 
> 1) add "int foo;" to the bottom of the clist.d file.
> 2) add "int* pfoo = &clist.foo" to one of the files that uses the CList template (any one that imports it).
> 
> See if you can link again.
> 
> -JJR

Sadly that does not fix it...same results.

:|

-DavidM
May 17, 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

David Medlock schrieb am Tue, 17 May 2005 10:50:44 -0400:
>
> Like I said I commented out all of SectorCache class members and the error persists.  Of course putting CList and SectorCache in a simple file alone does not generate the error.
>
> I can send you the project if you want to peruse it but the bottom line is the error message makes no sense whatsoever.  I could probably fix this on my own if I had some clue what was happening.

Please try to reduce the test case before sending it.
I'd be surprised if this requires more than 3 source files.

Thomas


-----BEGIN PGP SIGNATURE-----

iD8DBQFCijGn3w+/yD4P9tIRAkqqAKCMXfEwpLzYSDcpkDOFuAGl/X0RdwCgpBaZ
zgfepK8oHP95krCnQ5L7+MY=
=ADcW
-----END PGP SIGNATURE-----
May 17, 2005
"David Medlock" <noone@nowhere.com> wrote in message news:d6cqao$1b7t$1@digitaldaemon.com...
> Walter, I _IMPLORE_ you to clean up the error messages.
>
> In the meantime can someone please help to decode what the following gibberish means?  I don't have an init() method for the class SectorCache (nor its TypeInfo???) so I am pretty stumped here.

Note the __init_ isn't for an init() method but is the initial values of the class instance. Right after allocating the instance the __init values are copied to the allocated space and then the ctor is called. Do you have any variables of type CacheList declared in the same module where the CacheList alias is declared?

-Ben


May 17, 2005
David Medlock wrote:

> Sadly that does not fix it...same results.
> 
> :|
> 
> -DavidM

Okay... thanks for trying.  I was curious.  I don't know what else could be wrong.  Hopefully Walter can eventually point you in the right direction.

-JJR
May 17, 2005
Ben Hinkle wrote:
> "David Medlock" <noone@nowhere.com> wrote in message news:d6cqao$1b7t$1@digitaldaemon.com...
> 
>>Walter, I _IMPLORE_ you to clean up the error messages.
>>
>>In the meantime can someone please help to decode what the following gibberish means?  I don't have an init() method for the class SectorCache (nor its TypeInfo???) so I am pretty stumped here.
> 
> 
> Note the __init_ isn't for an init() method but is the initial values of the class instance. Right after allocating the instance the __init values are copied to the allocated space and then the ctor is called. Do you have any variables of type CacheList declared in the same module where the CacheList alias is declared?
> 
> -Ben 
> 
> 

Yes.  The type CList is still not making its way into the object file.
See my other thread in response to John.