Bug#417329: FTBFS with GCC 4.3: missing #includes

Martin Michlmayr tbm at cyrius.com
Mon Apr 2 10:55:50 UTC 2007


Package: libcommoncpp2
Version: 1.5.5-1
Usertags: ftbfs-gcc-4.3
Tags: patch

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 from unstable.


> Automatic build of libcommoncpp2_1.5.5-1 on em64t by sbuild/amd64 0.53
...
> mkdir .libs
>  x86_64-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I. -I../include -I../src -DCCXX_EXPORT_LIBRARY -D_GNU_SOURCE -I../include -MT thread.lo -MD -MP -MF .deps/thread.Tpo -c thread.cpp  -fPIC -DPIC -o .libs/thread.o
> thread.cpp: In member function 'void ost::MainThread::onSignal(int)':
> thread.cpp:400: error: 'exit' is not a member of 'std'
> make[2]: *** [thread.lo] Error 1

--- src/thread.cpp~	2007-04-02 10:41:47.000000000 +0000
+++ src/thread.cpp	2007-04-02 10:44:43.000000000 +0000
@@ -42,8 +42,10 @@
 #include <cc++/process.h>
 #ifdef	__BORLANDC__
 #include <stdio.h>
+#include <stdlib.h>
 #else
 #include <cstdio>
+#include <cstdlib>
 #endif
 #include "private.h"
 
--- src/file.cpp~	2007-04-02 10:43:49.000000000 +0000
+++ src/file.cpp	2007-04-02 10:44:37.000000000 +0000
@@ -60,8 +60,10 @@
 
 #ifdef	__BORLANDC__
 #include <stdio.h>
+#include <stdlib.h>
 #else
 #include <cstdio>
+#include <cstdlib>
 #endif
 #include <sys/stat.h>
 #include <cerrno>
--- src/string.cpp~	2007-04-02 10:45:40.000000000 +0000
+++ src/string.cpp	2007-04-02 10:45:52.000000000 +0000
@@ -46,9 +46,11 @@
 #ifdef	__BORLANDC__
 #include <stdarg.h>
 #include <stdio.h>
+#include <stdlib.h>
 #else
 #include <cstdarg>
 #include <cstdio>
+#include <cstdlib>
 #endif
 
 #ifdef	CCXX_NAMESPACES
--- src/xml.cpp~	2007-04-02 10:47:38.000000000 +0000
+++ src/xml.cpp	2007-04-02 10:48:21.000000000 +0000
@@ -50,6 +50,8 @@
 #include <syslog.h>
 #endif
 
+#include <cstdlib>
+
 // very ugly, but saves a lot of #ifdefs. To understand this, look at
 // the private members of XMLRPC.
 #ifndef HAVE_SSTREAM

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




More information about the Pkg-voip-maintainers mailing list