digitalmars.D.learn - Error 42: Symbol Undefined __lseeki64
- Byron Heads (5/5) Dec 16 2015 Seeing this issue on 2.069.2 using etc.c.zlib.
- Byron Heads (73/78) Dec 16 2015 I can reproduce with this code...
- Byron Heads (4/85) Dec 16 2015 Commenting out
- Byron Heads (7/113) Dec 16 2015 Submitted reduced case as a bug:
- tcak (6/24) Dec 16 2015 I searched the function "__lseek64" under /usr/include/dmd" with
- Byron Heads (4/9) Dec 17 2015 After some testing it seems that
- Basile B. (6/16) Dec 17 2015 Of course it's windows related. 'lseek' is a posix function.
Seeing this issue on 2.069.2 using etc.c.zlib. C:\d\dmd2\windows\bin\..\lib\phobos.lib(gzlib) Error 42: Symbol Undefined __lseeki64 The code was compiling in 2.067. Not clear on where to look to fix this issue.
Dec 16 2015
On Wednesday, 16 December 2015 at 17:23:15 UTC, Byron Heads wrote:Seeing this issue on 2.069.2 using etc.c.zlib. C:\d\dmd2\windows\bin\..\lib\phobos.lib(gzlib) Error 42: Symbol Undefined __lseeki64 The code was compiling in 2.067. Not clear on where to look to fix this issue.I can reproduce with this code... Windows dmd 2.069.2 32bit import std.stream; import std.exception; // todo: add bzip support.. class GZipBufferedFile : BufferedFile { private: GZipFile gZipFile; /** * GZipFile stream, safly opens and closes a gzip file, also will correctly read from the zip file */ class GZipFile : File { import std.c.stdio; import etc.c.zlib; FILE* fp; gzFile fpGZip; /** * Use gzopen to open the zip file */ this(string filename) { fp = fopen(filename.toStringz, "rb"); enforce(fp !is null, "Failed to open file '%s'".format(filename)); version(Windows) { fpGZip = gzdopen(fp._file, "rb"); super(fpGZip, FileMode.In); } else { fpGZip = gzdopen(fileno(fp), "rb"); super(cast(int)fpGZip, FileMode.In); } seekable = true; // Still not supported... sigh //gzbuffer(fpGZip, 1024 * 1024); } ulong tell() { fflush(fp); return ftell(fp); } /** * read data block with gzread */ override size_t readBlock(void* buffer, size_t size) { assertReadable(); size = gzread(fpGZip, buffer, cast(uint)size); if (size == -1) { size = 0; } // use gzeof to test for end of file readEOF = fpGZip.gzeof != 0; return size; } /** * make sure we close with gzclose */ override void close() { gzclose(fpGZip); fpGZip = null; fp = null; } } public: this(string filename) { gZipFile = new GZipFile(filename); super(gZipFile); } ulong tell() { return gZipFile.tell; } } void main() { }
Dec 16 2015
On Wednesday, 16 December 2015 at 18:14:35 UTC, Byron Heads wrote:On Wednesday, 16 December 2015 at 17:23:15 UTC, Byron Heads wrote:Commenting out gzclose(fpGZip); allows it to compile..Seeing this issue on 2.069.2 using etc.c.zlib. C:\d\dmd2\windows\bin\..\lib\phobos.lib(gzlib) Error 42: Symbol Undefined __lseeki64 The code was compiling in 2.067. Not clear on where to look to fix this issue.I can reproduce with this code... Windows dmd 2.069.2 32bit import std.stream; import std.exception; // todo: add bzip support.. class GZipBufferedFile : BufferedFile { private: GZipFile gZipFile; /** * GZipFile stream, safly opens and closes a gzip file, also will correctly read from the zip file */ class GZipFile : File { import std.c.stdio; import etc.c.zlib; FILE* fp; gzFile fpGZip; /** * Use gzopen to open the zip file */ this(string filename) { fp = fopen(filename.toStringz, "rb"); enforce(fp !is null, "Failed to open file '%s'".format(filename)); version(Windows) { fpGZip = gzdopen(fp._file, "rb"); super(fpGZip, FileMode.In); } else { fpGZip = gzdopen(fileno(fp), "rb"); super(cast(int)fpGZip, FileMode.In); } seekable = true; // Still not supported... sigh //gzbuffer(fpGZip, 1024 * 1024); } ulong tell() { fflush(fp); return ftell(fp); } /** * read data block with gzread */ override size_t readBlock(void* buffer, size_t size) { assertReadable(); size = gzread(fpGZip, buffer, cast(uint)size); if (size == -1) { size = 0; } // use gzeof to test for end of file readEOF = fpGZip.gzeof != 0; return size; } /** * make sure we close with gzclose */ override void close() { gzclose(fpGZip); fpGZip = null; fp = null; } } public: this(string filename) { gZipFile = new GZipFile(filename); super(gZipFile); } ulong tell() { return gZipFile.tell; } } void main() { }
Dec 16 2015
On Wednesday, 16 December 2015 at 18:21:33 UTC, Byron Heads wrote:On Wednesday, 16 December 2015 at 18:14:35 UTC, Byron Heads wrote:Submitted reduced case as a bug: https://issues.dlang.org/show_bug.cgi?id=15457 import etc.c.zlib; void main() { gzclose(null); }On Wednesday, 16 December 2015 at 17:23:15 UTC, Byron Heads wrote:Commenting out gzclose(fpGZip); allows it to compile..Seeing this issue on 2.069.2 using etc.c.zlib. C:\d\dmd2\windows\bin\..\lib\phobos.lib(gzlib) Error 42: Symbol Undefined __lseeki64 The code was compiling in 2.067. Not clear on where to look to fix this issue.I can reproduce with this code... Windows dmd 2.069.2 32bit import std.stream; import std.exception; // todo: add bzip support.. class GZipBufferedFile : BufferedFile { private: GZipFile gZipFile; /** * GZipFile stream, safly opens and closes a gzip file, also will correctly read from the zip file */ class GZipFile : File { import std.c.stdio; import etc.c.zlib; FILE* fp; gzFile fpGZip; /** * Use gzopen to open the zip file */ this(string filename) { fp = fopen(filename.toStringz, "rb"); enforce(fp !is null, "Failed to open file '%s'".format(filename)); version(Windows) { fpGZip = gzdopen(fp._file, "rb"); super(fpGZip, FileMode.In); } else { fpGZip = gzdopen(fileno(fp), "rb"); super(cast(int)fpGZip, FileMode.In); } seekable = true; // Still not supported... sigh //gzbuffer(fpGZip, 1024 * 1024); } ulong tell() { fflush(fp); return ftell(fp); } /** * read data block with gzread */ override size_t readBlock(void* buffer, size_t size) { assertReadable(); size = gzread(fpGZip, buffer, cast(uint)size); if (size == -1) { size = 0; } // use gzeof to test for end of file readEOF = fpGZip.gzeof != 0; return size; } /** * make sure we close with gzclose */ override void close() { gzclose(fpGZip); fpGZip = null; fp = null; } } public: this(string filename) { gZipFile = new GZipFile(filename); super(gZipFile); } ulong tell() { return gZipFile.tell; } } void main() { }
Dec 16 2015
On Wednesday, 16 December 2015 at 18:30:41 UTC, Byron Heads wrote:On Wednesday, 16 December 2015 at 18:21:33 UTC, Byron Heads wrote:I searched the function "__lseek64" under /usr/include/dmd" with "grep -R __lseek64", but nothing is found. I work on Linux 64-bit. So, I guess it is either Windows related, or 32bit dmd related. "lseek64" is found in "unistd.d", but this doesn't solve any problem.On Wednesday, 16 December 2015 at 18:14:35 UTC, Byron Heads wrote:Submitted reduced case as a bug: https://issues.dlang.org/show_bug.cgi?id=15457 import etc.c.zlib; void main() { gzclose(null); }[...]Commenting out gzclose(fpGZip); allows it to compile..
Dec 16 2015
On Thursday, 17 December 2015 at 04:11:56 UTC, tcak wrote:I searched the function "__lseek64" under /usr/include/dmd" with "grep -R __lseek64", but nothing is found. I work on Linux 64-bit. So, I guess it is either Windows related, or 32bit dmd related. "lseek64" is found in "unistd.d", but this doesn't solve any problem.After some testing it seems that -m32mscoff and -m64 both build correctly so its related to 32bit dmd on windows
Dec 17 2015
On Thursday, 17 December 2015 at 04:11:56 UTC, tcak wrote:On Wednesday, 16 December 2015 at 18:30:41 UTC, Byron Heads wrote:Of course it's windows related. 'lseek' is a posix function. There's a version/#define somewhere that's missing, maybe in the C binding, because under Windows lseek is 'SetFilePointer'. But I'm not able to find it... :/On Wednesday, 16 December 2015 at 18:21:33 UTC, Byron Heads wrote:I searched the function "__lseek64" under /usr/include/dmd" with "grep -R __lseek64", but nothing is found. I work on Linux 64-bit. So, I guess it is either Windows related, or 32bit dmd related. "lseek64" is found in "unistd.d", but this doesn't solve any problem.On Wednesday, 16 December 2015 at 18:14:35 UTC, Byron Heads
Dec 17 2015