fread64 fwrite64 compilation problem (undefined symbol)

I use a standard C source to access large files in a 32 bit environment.
I've replaced fopen, fwrite and fread by fopen64, fwrite64 and fread64.
First I did a test only replacing fopen by fopen64, it compiled without any other changes to my compilation options.
The program crashed on a write, as I expected. then I replaced fwrite and fread by fwrite64 & fread64. But then I cannot compile it!!
Here's the error :
cc -c mergesor.c
cc -I/include -c smergeso.c
cc -o sort_msr13 sort.c llmsort.o mergesor.o smergeso.o
ld: 0711-317 ERROR: Undefined symbol: .fwrite64
ld: 0711-317 ERROR: Undefined symbol: .fread64

I tried with these macros :

#define _LARGEFILE64_SOURCE
#define _FILE_OFFSET_BITS 64
#include <stdio.h>
etc...

But without success

Can you help?
What should I add to allow fread64 and fwrite64?

I think the functions fwrite64 and fread64 do not exist.

So i think you should be able to use fread to read from a file, opened with fopen64. but i have not tried it.

----

man fopen:
fopen, fopen64, freopen, freopen64 or fdopen Subroutine

man fread:
fread or fwrite Subroutine

man ftell
fseek, fseeko, fseeko64, rewind, ftell, ftello, ftello64, fgetpos, fgetpos64,
fsetpos, or fsetpos64 Subroutine

It's not obvious to me which OS you're trying to use "large" files with.

There are defines to use to enable 64 bit file sizes. What most of them do is to create different declarations for standard functions like fopen.... those new entry points usually have mangled names like __fopen64().

Secondly, on some OSes, the kernel has to be configured to use large files.

In some cases large file support is built in to the libc library and the kernel by default.

It depends on which UNIX you're using. Standards are spotty in this area, or at least too new to be well-established.

On some, like 32-bit linux, there's no fundamental difference between large and small files; they're just....bigger. The same reading, writing, opening, and closing functions can be used for them -- the only problem they give the programmer is how to seek to a farther point than you can specify with a 32-bit integer. To get around this the linux kernel has one special 64-bit seek function, _llseek. It's a better idea to use a real API of some sort than a raw system call though.

32-bit Solaris, on the other hand, will apparently puke with an overflow error if you so much as open a large file without their large-file open! To get around this they provided <insert function name here>64 functions for nearly everything.

Looking in my linux system's stdio.h, I see fseeko64 and ftello64 functions. If your system has these or something like them, they might be all you need.

If you don't have these under stdio, you may need to use the underlying system functions.