etc.c.zlib help

Laeeth Isharc via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jul 3 12:09:19 PDT 2015


On Friday, 3 July 2015 at 16:28:29 UTC, Matthew Gamble wrote:
> On Friday, 3 July 2015 at 02:16:45 UTC, Mike Parker wrote:
>> On 7/3/2015 8:44 AM, Matthew Gamble wrote:
>>>[...]
>> The Phobos source actually includes the C source for zlib. You 
>> can find it in the DMD distribution in src/phobos/etc/c/zlib/. 
>> When Phobos is compiled, it also compiles zlib and pulls the 
>> library into the final Phobos lib. You don't need the zlib DLL.
>>
>> You have no error in 64-bit because it's working as expected. 
>> The trick now is to determine what's screwing things up in 
>> 32-bit. The starting point is at [1]. A quick bit of googling 
>> appears to suggest that _lseeki64 is a function specific to 
>> the Microsoft C runtime. I assume you're seeing the linker 
>> error because the DMC C runtime, which is the default used by 
>> DMD on Windows, does not include this function. If you compile 
>> using -m32mscoff (which also requires compiling a compatible 
>> version of Phobos), you'll be using the MS toolchain for 
>> 32-bit and the error should go away.
>>
>> This is all assumption, but it's where I would start. And if 
>> this actually is the issue ([2] suggests it is), I'm surprised 
>> it hasn't turned up before now.
>>
>> [1] 
>> https://github.com/D-Programming-Language/phobos/blob/master/etc/c/zlib/gzlib.c#L8
>> [2] 
>> http://www.digitalmars.com/d/archives/c++/windows/32-bits/440.html
>
> Wow Mike. This seems like the most likely explanation to me. 
> I'm a bit hesitant to compile phobos from source on this 
> machine with -m32mscoff. Perhaps a similar test would be to 
> compile my program on a 32-bit windows machine? I can do this 
> at work on Monday. If you are correct is this something that 
> should be reported and where would I do that?
>
> Best,
>
> Matt

BTW just so you know, having had a few horrendous experiences of 
installing other programs from scratch under linux with recursive 
pain when other programs they pull in also had problems: dmd + 
phobos are extremely easy and quick to compile (based on my own 
experience, which is all I can speak of).

There are personal psychological benefits to going through the 
experience once because one no longer thinks of things as a 
closed box one dare not touch, and acquires a deeper knowledge of 
the language and library.  And it won't mess up your main install 
of dmd because make install puts the files in a subdirectory (at 
least on linux - you should check if true of windows,but I should 
think so) rather than touching the base install.



More information about the Digitalmars-d-learn mailing list