www.digitalmars.com         C & C++   DMDScript  

c++ - Undefined symbols: __lseeki64 & __telli64

reply "Brian Gardner" <briangr friberg.us> writes:
Why OPTLINK reports undefined symbols __lseeki64 and __telli64 (Error 42)
for the following code:
#include <io.h>
#include <fcntl.h>
#include <sys\stat.h>

#include <stdio.h>

int main(void){
int output = _open("temp", _O_BINARY | _O_WRONLY | _O_CREAT | _O_TRUNC,
_S_IREAD | _S_IWRITE);

long x = 97;

_write(output, &x, sizeof(x));
printf("%lld\n", _telli64(output));

_lseeki64(output, 0, SEEK_SET);

 return _close(output);}

Thanks,
Brian
Nov 04 2004
parent reply "Walter" <newshound digitalmars.com> writes:
Because those two symbols are not part of the runtime library. Just use
lseek() and tell() instead.

"Brian Gardner" <briangr friberg.us> wrote in message
news:cmdpul$21am$1 digitaldaemon.com...
 Why OPTLINK reports undefined symbols __lseeki64 and __telli64 (Error 42)
 for the following code:
 #include <io.h>
 #include <fcntl.h>
 #include <sys\stat.h>

 #include <stdio.h>

 int main(void){
 int output = _open("temp", _O_BINARY | _O_WRONLY | _O_CREAT | _O_TRUNC,
 _S_IREAD | _S_IWRITE);

 long x = 97;

 _write(output, &x, sizeof(x));
 printf("%lld\n", _telli64(output));

 _lseeki64(output, 0, SEEK_SET);

  return _close(output);}

 Thanks,
 Brian

Nov 04 2004
parent reply "Brian Gardner" <briangr friberg.us> writes:
I can't use _lseek and _tell, because I need fast r/w access to files > 2GB.
Can you offer me more conveniently solution than to use _lseeki64 & _telli64
with mingw gcc?

Thank you,
Brian

"Walter" <newshound digitalmars.com> wrote in message
news:cme3hd$2fli$1 digitaldaemon.com...
 Because those two symbols are not part of the runtime library. Just use
 lseek() and tell() instead.

 "Brian Gardner" <briangr friberg.us> wrote in message
 news:cmdpul$21am$1 digitaldaemon.com...
 Why OPTLINK reports undefined symbols __lseeki64 and __telli64 (Error


 for the following code:


Nov 04 2004
parent "Walter" <newshound digitalmars.com> writes:
You can access the Win32 file API directly, which are ReadFile(), and
WriteFile().

"Brian Gardner" <briangr friberg.us> wrote in message
news:cme71n$2kk1$1 digitaldaemon.com...
 I can't use _lseek and _tell, because I need fast r/w access to files >

 Can you offer me more conveniently solution than to use _lseeki64 &

 with mingw gcc?

 Thank you,
 Brian

 "Walter" <newshound digitalmars.com> wrote in message
 news:cme3hd$2fli$1 digitaldaemon.com...
 Because those two symbols are not part of the runtime library. Just use
 lseek() and tell() instead.

 "Brian Gardner" <briangr friberg.us> wrote in message
 news:cmdpul$21am$1 digitaldaemon.com...
 Why OPTLINK reports undefined symbols __lseeki64 and __telli64 (Error


 for the following code:



Nov 04 2004