Thread overview
dmd v0.94
Jul 02, 2004
Regan Heath
Jul 02, 2004
J C Calvarese
Jul 02, 2004
Regan Heath
Jul 02, 2004
Regan Heath
Jul 04, 2004
Regan Heath
Jul 04, 2004
Regan Heath
July 02, 2004
Unzip the attached zip and run doit.cmd (if you're on windows, if not compile all .d files and link them) the error reported is:

D:\D\src\build\temp\a>doit
D:\d\dmd\bin\..\..\dm\bin\link.exe *,test.exe,,user32+kernel32/co/noi;
OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

md5.obj(md5)  Offset 00340H Record Type 00C3
  Error 1: Previous Definition Different :
_D4hash18digestStringT_G16h13digestStr
ingTFG16hZAa
--- errorlevel 1

I believe what is happening is that md4 and md5 both create an instance of the code in digestStringT needed to process a ubyte[16] and they then collide upon linking.

Help!

Regan.

-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

July 02, 2004
In article <opsaiglfdb5a2sq9@digitalmars.com>, Regan Heath says...
>
>------------kvDqzFtSa4vbkwNmbsoA8z
>Content-Type: text/plain; format=flowed; charset=iso-8859-15 Content-Transfer-Encoding: 8bit
>
>Unzip the attached zip and run doit.cmd (if you're on windows, if not compile all .d files and link them) the error reported is:
>
>D:\D\src\build\temp\a>doit
>D:\d\dmd\bin\..\..\dm\bin\link.exe *,test.exe,,user32+kernel32/co/noi;
>OPTLINK (R) for Win32  Release 7.50B1
>Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
>
>md5.obj(md5)  Offset 00340H Record Type 00C3
>  Error 1: Previous Definition Different :
>_D4hash18digestStringT_G16h13digestStr
>ingTFG16hZAa
>--- errorlevel 1
>
>I believe what is happening is that md4 and md5 both create an instance of the code in digestStringT needed to process a ubyte[16] and they then collide upon linking.
>
>Help!
>
>Regan.

I agree that you seem to have found some sort of compiler or linker error, but did you realize there's a work-around?

I compiled them all at once like this:
dmd main.d hash.d md4.d md5.d

This is my result:
c:\dmd\bin\..\..\dm\bin\link.exe main+hash+md4+md5,,,user32+kernel32/noi;
00000000000000000000000000000000
d41d8cd98f00b204e9800998ecf8427e
00000000000000000000000000000000
DONE  main

(I don't know whether it's right or not, but it doesn't generate any errors.)

jcc7
July 02, 2004
Yes, I've seen this same problem happening with template instance when the files where compiled separately.

The solution is either alias instances of the template in one file and use only the aliases or compile all files at the same time.

Regan Heath wrote:

> Unzip the attached zip and run doit.cmd (if you're on windows, if not compile all .d files and link them) the error reported is:
> 
> D:\D\src\build\temp\a>doit
> D:\d\dmd\bin\..\..\dm\bin\link.exe *,test.exe,,user32+kernel32/co/noi;
> OPTLINK (R) for Win32  Release 7.50B1
> Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
> 
> md5.obj(md5)  Offset 00340H Record Type 00C3
>  Error 1: Previous Definition Different : _D4hash18digestStringT_G16h13digestStr
> ingTFG16hZAa
> --- errorlevel 1
> 
> I believe what is happening is that md4 and md5 both create an instance of the code in digestStringT needed to process a ubyte[16] and they then collide upon linking.
> 
> Help!
> 
> Regan.
> 


-- 
Julio César Carrascal Urquijo
July 02, 2004
On Fri, 2 Jul 2004 19:42:49 +0000 (UTC), J C Calvarese <jcc7@cox.net> wrote:

> In article <opsaiglfdb5a2sq9@digitalmars.com>, Regan Heath says...
>>
>> ------------kvDqzFtSa4vbkwNmbsoA8z
>> Content-Type: text/plain; format=flowed; charset=iso-8859-15
>> Content-Transfer-Encoding: 8bit
>>
>> Unzip the attached zip and run doit.cmd (if you're on windows, if not
>> compile all .d files and link them) the error reported is:
>>
>> D:\D\src\build\temp\a>doit
>> D:\d\dmd\bin\..\..\dm\bin\link.exe *,test.exe,,user32+kernel32/co/noi;
>> OPTLINK (R) for Win32  Release 7.50B1
>> Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
>>
>> md5.obj(md5)  Offset 00340H Record Type 00C3
>>  Error 1: Previous Definition Different :
>> _D4hash18digestStringT_G16h13digestStr
>> ingTFG16hZAa
>> --- errorlevel 1
>>
>> I believe what is happening is that md4 and md5 both create an instance of
>> the code in digestStringT needed to process a ubyte[16] and they then
>> collide upon linking.
>>
>> Help!
>>
>> Regan.
>
> I agree that you seem to have found some sort of compiler or linker error, but
> did you realize there's a work-around?

No.

> I compiled them all at once like this:
> dmd main.d hash.d md4.d md5.d

Ahh of course.. so the bug only occurs when compiling seperately.

> This is my result:
> c:\dmd\bin\..\..\dm\bin\link.exe main+hash+md4+md5,,,user32+kernel32/noi;
> 00000000000000000000000000000000
> d41d8cd98f00b204e9800998ecf8427e
> 00000000000000000000000000000000
> DONE  main
>
> (I don't know whether it's right or not, but it doesn't generate any errors.)

It's right, all the code to actually make a digest was removed from that sample.

Thanks for this.

Regan

-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
July 02, 2004
On Fri, 02 Jul 2004 15:37:05 -0500, Julio César Carrascal Urquijo <adnoctum@phreaker.net> wrote:

> Yes, I've seen this same problem happening with template instance when the files where compiled separately.
>
> The solution is either alias instances of the template in one file and use only the aliases

I think I'll do this. Thanks.

> or compile all files at the same time.

Yeah.. JC told me this too.

Thanks for your help,
Regan

> Regan Heath wrote:
>
>> Unzip the attached zip and run doit.cmd (if you're on windows, if not compile all .d files and link them) the error reported is:
>>
>> D:\D\src\build\temp\a>doit
>> D:\d\dmd\bin\..\..\dm\bin\link.exe *,test.exe,,user32+kernel32/co/noi;
>> OPTLINK (R) for Win32  Release 7.50B1
>> Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
>>
>> md5.obj(md5)  Offset 00340H Record Type 00C3
>>  Error 1: Previous Definition Different : _D4hash18digestStringT_G16h13digestStr
>> ingTFG16hZAa
>> --- errorlevel 1
>>
>> I believe what is happening is that md4 and md5 both create an instance of the code in digestStringT needed to process a ubyte[16] and they then collide upon linking.
>>
>> Help!
>>
>> Regan.
>>
>
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
July 04, 2004
On Fri, 02 Jul 2004 15:37:05 -0500, Julio César Carrascal Urquijo <adnoctum@phreaker.net> wrote:

> Yes, I've seen this same problem happening with template instance when the files where compiled separately.
>
> The solution is either alias instances of the template in one file and use only the aliases or compile all files at the same time.

I just tried to do this with this example, I cannot seem to get it to work, can you show me how?
Perhaps by changing my example and reposting it?

Thanks,
Regan

> Regan Heath wrote:
>
>> Unzip the attached zip and run doit.cmd (if you're on windows, if not compile all .d files and link them) the error reported is:
>>
>> D:\D\src\build\temp\a>doit
>> D:\d\dmd\bin\..\..\dm\bin\link.exe *,test.exe,,user32+kernel32/co/noi;
>> OPTLINK (R) for Win32  Release 7.50B1
>> Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
>>
>> md5.obj(md5)  Offset 00340H Record Type 00C3
>>  Error 1: Previous Definition Different : _D4hash18digestStringT_G16h13digestStr
>> ingTFG16hZAa
>> --- errorlevel 1
>>
>> I believe what is happening is that md4 and md5 both create an instance of the code in digestStringT needed to process a ubyte[16] and they then collide upon linking.
>>
>> Help!
>>
>> Regan.
>>
>
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
July 04, 2004
On Sun, 04 Jul 2004 12:31:33 +1200, Regan Heath <regan@netwin.co.nz> wrote:

> On Fri, 02 Jul 2004 15:37:05 -0500, Julio César Carrascal Urquijo <adnoctum@phreaker.net> wrote:
>
>> Yes, I've seen this same problem happening with template instance when the files where compiled separately.
>>
>> The solution is either alias instances of the template in one file and use only the aliases or compile all files at the same time.
>
> I just tried to do this with this example, I cannot seem to get it to work, can you show me how?
> Perhaps by changing my example and reposting it?

I'm so slow sometimes.. I have worked it out, thanks for this idea.
Regan

> Thanks,
> Regan
>
>> Regan Heath wrote:
>>
>>> Unzip the attached zip and run doit.cmd (if you're on windows, if not compile all .d files and link them) the error reported is:
>>>
>>> D:\D\src\build\temp\a>doit
>>> D:\d\dmd\bin\..\..\dm\bin\link.exe *,test.exe,,user32+kernel32/co/noi;
>>> OPTLINK (R) for Win32  Release 7.50B1
>>> Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
>>>
>>> md5.obj(md5)  Offset 00340H Record Type 00C3
>>>  Error 1: Previous Definition Different : _D4hash18digestStringT_G16h13digestStr
>>> ingTFG16hZAa
>>> --- errorlevel 1
>>>
>>> I believe what is happening is that md4 and md5 both create an instance of the code in digestStringT needed to process a ubyte[16] and they then collide upon linking.
>>>
>>> Help!
>>>
>>> Regan.
>>>
>>
>>
>
>
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/