[libvirt] ULLONG_MAX undeclared

Hi, I subscribed today on the list because I have a compilation problem of libvirt 0.4.2 and 0.4.3 (didn't try the other versions). I'm trying to compile libvirt on a Debian Etch with Xen 3.2.0 (also tried with a 3.2.1) Every time I have this mistake: storage_conf.c: In function 'virStorageSize': storage_conf.c:659: error: 'ULLONG_MAX' undeclared (first use in this function) storage_conf.c:659: error: (Each undeclared identifier is reported only once storage_conf.c:659: error: for each function it appears in.) make[2]: *** [libvirt_la-storage_conf.lo] Error 1 make[2]: Leaving directory `/usr/src/libvirt-0.4.2/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/src/libvirt-0.4.2' make: *** [all] Error 2 I looked for ULLONG_MAX and find it in /usr/include/limits.h and /usr/include/linux/kernel.h So first I decided to add #include <limits.h> inside storage_conf.c but it didn't change anything. Surely the definition of ULLONG_MAX is surrounded by an "unwelcome" condition. So actually to succeed the compilation I directly added: # define ULLONG_MAX 18446744073709551615ULL inside the files (storage_backend_fs.c need it too). I know that's dirty, so is there anybody who can help me to make it in a clean way? Thank you by advance. Best Regards, Alex

On Wed, Jun 25, 2008 at 06:01:10PM +0200, a.hocquel@free.fr wrote:
Hi,
I subscribed today on the list because I have a compilation problem of libvirt 0.4.2 and 0.4.3 (didn't try the other versions). I'm trying to compile libvirt on a Debian Etch with Xen 3.2.0 (also tried with a 3.2.1) Every time I have this mistake:
storage_conf.c: In function 'virStorageSize': storage_conf.c:659: error: 'ULLONG_MAX' undeclared (first use in this function) storage_conf.c:659: error: (Each undeclared identifier is reported only once storage_conf.c:659: error: for each function it appears in.) make[2]: *** [libvirt_la-storage_conf.lo] Error 1 make[2]: Leaving directory `/usr/src/libvirt-0.4.2/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/src/libvirt-0.4.2' make: *** [all] Error 2
I looked for ULLONG_MAX and find it in /usr/include/limits.h and /usr/include/linux/kernel.h So first I decided to add #include <limits.h> inside storage_conf.c but it didn't change anything. Surely the definition of ULLONG_MAX is surrounded by an "unwelcome" condition.
On Fedora at least the definition is surrounded by a __USE_ISOC99. I'm not sure why that would work with Fedora but not with Debian. What version of GLibc and GCC is used on Debian Etch ? Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

Thank you for the quick reply. ----- "Daniel P. Berrange" <berrange@redhat.com> wrote:
On Fedora at least the definition is surrounded by a __USE_ISOC99. I'm not sure why that would work with Fedora but not with Debian. What version of GLibc and GCC is used on Debian Etch ?
gcc -v Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --with-tune=i686 --enable-checking=release i486-linux-gnu Thread model: posix gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) and: libc-2.3.6 Alex PS: sorry for the direct reply
participants (3)
-
a.hocquel@free.fr
-
Alexandre Hocquel
-
Daniel P. Berrange