RH7.2 2.4.X off_t: long or long long?

RH7.2 2.4.X off_t: long or long long?

Post by aglyportat\" » Mon, 17 Jun 2002 11:12:28



I have an odd problem trying to link my app:

glog.o(.text+0x100a): undefined reference to `loadfile(char const *,
long long *)'
collect2: ld returned 1 exit status

in loadfile.C:

char *
loadfile(const char *path, off_t *length)
{
        ...

and the declaration in the header is:

char *loadfile(const char *path, off_t *size=0);

nm -C libgen.a |grep loadfil
          U loadfile(char const *, long *)
loadfile.o:
00000000 T loadfile(char const *, long *)
          U loadfile(char const *, long long *)

Why are there two references differing in the last arg? Is off_t
supposed to be long or long long?

Thank you!

 
 
 

RH7.2 2.4.X off_t: long or long long?

Post by aglyportat\" » Mon, 17 Jun 2002 11:40:43



> I have an odd problem trying to link my app:

> glog.o(.text+0x100a): undefined reference to `loadfile(char const *,
> long long *)'
> collect2: ld returned 1 exit status

> in loadfile.C:

> char *
> loadfile(const char *path, off_t *length)
> {
>     ...

> and the declaration in the header is:

> char *loadfile(const char *path, off_t *size=0);

> nm -C libgen.a |grep loadfil
>          U loadfile(char const *, long *)
> loadfile.o:
> 00000000 T loadfile(char const *, long *)
>          U loadfile(char const *, long long *)

> Why are there two references differing in the last arg? Is off_t
> supposed to be long or long long?

> Thank you!

Nevermind, this had something to do with Python.h that I've included.
Removed the inclusion of Python.h and everything works fine.

For some odd reason

/* The number of bytes in an off_t. */
#define SIZEOF_OFF_T 8

is defined in pyconfig.h which is used by Python.h but oddly there is no
redefinition of off_t anywhere in Python files. Kinda puzzling.

 
 
 

1. long long & long double types in Linux GCC

There are two non-standard types defined in Linux GCC: long long (8 bytes)
and "long double" (12 bytes, but I think it uses 10 bytes floating point
type supported by 80x87 coprocessor). Both seem to work internally OK,
but is there a way to "printf" such values. Man page for "printf" does mention a
format modifier "L" for long double values, but it is not working. Nothing
about "long long" can be found in manpage.

Any experience with these types?

regards, Michal.

****************************************************************************


  Al. Ujazdowskie 4                   Voice:    48-22-294011 ext 23
  00-478 Warszawa, POLAND             FAX:      48-22-294967
****************************************************************************

2. bttv and wintv problems

3. Linux has a long, long, long way to go

4. Coldfusion, Solaris & Apache?

5. error using unsigned long long not working in 2.4.x

6. Sun Security Bulletin (#00143)

7. Q: about "long long" type..

8. GNU C and Lib books

9. loff_t / long long and printk()?

10. _BSD_OFF_T_ type long long

11. printf(3) long long

12. Large File System and long long datatype (gcc)

13. does tru64 v.4.g support long long int (%lld)?