On Thursday, 2 July 2015 at 03:07:43 UTC, Matthew Gamble wrote:
I am trying to make the transition from C++ to D. I've hit a snag with the etc.c.zlib module where any attempt to use this module to open a file yields an error:
Error 42: Symbol Undefined __lseeki64.

Here is a simple example of code that gives the error upon compilation.

import std.stdio;
import etc.c.zlib;

void main(string[] args)
{
char[] fName = "C:\\Users\\Matthew Gamble\\Documents\\sample.bam\0".dup;
        char[] mode ="r\0".dup;
        gzFile bamFile; //no error here
bamFile = gzopen(&fName[0],&mode[0]); //this is where the error hits
}

I'm using DMD32 D Compiler v2.067.1 on a windows 8 64 bit machine. Working from either Visual D in Visual Studio 2013 Community and Coedit as IDEs gives the error. I'm probably doing something obviously wrong, so have mercy. If etc.c.zlib is not the preferred way to read from a binary gzipped file any advice would be appreciated. Thanks.

Hi.

The etc.c.zlib headers are, I think, just translations of the C headers and allow you to link with an external library. If the library is not installed, or the compiler/linker cannot find them then you may have a link error. Are you sure that Visual Studio knows where to find the zlib library binary ? Can you try compiling your project with DMD from the command line appending -L-lz (that might work on linux, but I don't know on windows)? There is a program called everything from void tools that may be helpful in finding the library file if its location is not obvious.

Laeeth

Reply via email to