Fwd: Bug#417488: FTBFS with GCC 4.3: missing #includes

Peter Eisentraut peter_e at gmx.net
Tue Apr 10 00:47:58 PDT 2007


Please consider the following fix for GCC 4.3.

----------  Weitergeleitete Nachricht  ----------

Subject: Bug#417488: FTBFS with GCC 4.3: missing #includes
Date: Montag, 2. April 2007 23:28
From: Martin Michlmayr <tbm at cyrius.com>
To: submit at bugs.debian.org

Package: apt-rpm
Version: 0.5.15lorg3.2-1
Usertags: ftbfs-gcc-4.3

Your package fails to build with GCC 4.3.  Version 4.3 has not been
released yet but I'm building with a snapshot in order to find errors
and give people an advance warning.  In GCC 4.3, the C++ header
dependencies have been cleaned up.  The advantage of this is that
programs will compile faster.  The downside is that you actually
need to directly #include everything you use (but you really should
do this anyway, otherwise your program won't work with any compiler
other than GCC).  Some background of this can be found at
http://gcc.gnu.org/PR28080

You can reproduce this problem with gcc-snapshot (20070326-1 or higher)

>from unstable.  I'll try to look into this problem but I don't know when

I'll have time.

> Automatic build of apt-rpm_0.5.15lorg3.2-1 on coconut0 by sbuild/ia64 0.49

...

>  g++ -DHAVE_CONFIG_H -I. -I. -I../include -DLIBDIR=\"/usr/lib\"
> -DPKGDATADIR=\"/usr/share/apt\" -I../lua/include -I../lua/local
> -I/usr/include/libxml2 -I/usr/include/rpm -g -Wall -O2 -c
> contrib/cdromutl.cc  -fPIC -DPIC -o contrib/.libs/cdromutl.o
> contrib/cdromutl.cc: In function 'bool UnmountCdrom(std::string)':
> contrib/cdromutl.cc:97: error: 'system' was not declared in this scope
> contrib/cdromutl.cc: In function 'bool MountCdrom(std::string)':
> contrib/cdromutl.cc:145: error: 'system' was not declared in this scope
> make[2]: *** [contrib/cdromutl.lo] Error 1

--
Martin Michlmayr
http://www.cyrius.com/

-------------------------------------------------------

--- apt-pkg/contrib/cdromutl.cc~        2007-04-05 11:10:50.000000000 +0200
+++ apt-pkg/contrib/cdromutl.cc 2007-04-05 11:11:01.000000000 +0200
@@ -34,6 +34,7 @@
 #include <sys/stat.h>
 #include <unistd.h>
 #include <stdio.h>
+#include <stdlib.h>
                                                                        /*}}}*/
 
 // IsMounted - Returns true if the mount point is 
mounted              /*{{{*/
--- apt-pkg/contrib/fileutl.cc~ 2007-04-05 11:11:26.000000000 +0200
+++ apt-pkg/contrib/fileutl.cc  2007-04-05 11:11:36.000000000 +0200
@@ -21,6 +21,7 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/sptr.h>
 
+#include <cstdlib>
 #include <iostream>
 #include <unistd.h>
 #include <fcntl.h>
--- apt-pkg/init.cc~    2007-04-05 11:14:47.000000000 +0200
+++ apt-pkg/init.cc     2007-04-05 11:14:55.000000000 +0200
@@ -12,6 +12,7 @@
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/error.h>
 
+#include <cstdlib>
 #include <apti18n.h>
 #include <config.h>
 #include <sys/stat.h>



More information about the Apt-Rpm mailing list