etc.c.zlib help

Matthew Gamble via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jul 3 09:28:27 PDT 2015


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


More information about the Digitalmars-d-learn mailing list