Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 01-20-2004, 03:51 AM   #1
LQ Newbie
Registered: Jan 2004
Posts: 25

Rep: Reputation: 15
Question large file support compiler with other tools!?

Dear all,

To handle large file, the I/O functions off_t type should be 64 bit.
I define 2 macros.
I use g++ to compiler, it work fine.
But when I use Kylix to compile, there is an error.
Because the type "__quad_t" is a struct. it can't cast a long(/long) int.
The g++ typedef __quad_t long long int. (please reference bits/types.h)
If I use off64_t, kylix still can't cast.

If I define a macro __GNUC__ ,
there are other erros appeared in some header file.

How should I do then can get __quad_t is a long long int?
Please help, thanks.

my code:
#define _FILE_OFFSET_BITS 64
#include <stdio.h>
#include <fcntl.h>
#include <limits.h>

int main(int argc, char* argv[])

int fd=open("/tmp/test.txt",O_RDONLY);
if (fd<0) {
return -1;
void *buf;
double i=0;

//using off_t mm=lseek(fd,off_t(ULONG_MAX),SEEK_SET);no used too.
off_t mm=lseek(fd,ULONG_MAX,SEEK_SET);
while (read(fd,buf,10)>0) {
printf("%s at offset %f\n",(char*)buf,ULONG_MAX+(++i)*10);
return 0;
The compiler error:
E2034 Cannot convert 'unsigned long' to '__quad_t'
E2342 Type mismatch in parameter '__offset'(wanted '__quad_t,got
'unsigned long')


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Where can I get info about Large File Support on woody? MrinCodex Debian 3 05-19-2005 12:01 PM
Large file size support for linux merlin23 Linux - Newbie 11 01-11-2005 08:01 AM
How to enable large file support (LFS)? maddmike SUSE / openSUSE 0 12-27-2004 10:45 AM
Large File Support on a 32-bit machine JapanMtlExpat Linux - Software 3 11-26-2004 02:50 AM
File does not exist/Large file support dreamtheater Linux - General 3 04-19-2004 09:14 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:18 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration