[Pkg-octave-devel] Bug#504945: FTBFS with GCC 4.4: missing #include

Martin Michlmayr tbm at cyrius.com
Sat Nov 8 06:09:00 UTC 2008


Package: octave3.0
Version: 1:3.0.1-6lenny1
User: debian-gcc at lists.debian.org
Usertags: ftbfs-gcc-4.4

Your package fails to build with the upcoming GCC 4.4.  Version 4.4
has not been released yet but I'm building with a snapshot in order
to find errors and give people an advance warning.

GCC 4.4 cleaned up some more C++ headers.  You always have to #include
headers directly and cannot rely for things to be included indirectly.

You can reproduce this problem with gcc-snapshot from unstable.

> Automatic build of octave3.0_1:3.0.1-6lenny1 on em64t by sbuild/amd64 0.53
> g++ -c  -fPIC -I. -I.. -I../liboctave -I../src -I../libcruft/misc  -DHAVE_CONFIG_H  -Wall -W -Wshadow -Wold-style-cast -O2 -g oct-md5.cc -o pic/oct-md5.o
> oct-md5.cc: In function 'std::string oct_md5(std::string)':
> oct-md5.cc:47: error: 'sprintf' was not declared in this scope
> oct-md5.cc: In function 'std::string oct_md5_file(std::string)':
> oct-md5.cc:55: error: 'fopen' was not declared in this scope
> oct-md5.cc:73: error: 'fread' was not declared in this scope
> oct-md5.cc:76: error: 'fclose' was not declared in this scope
> oct-md5.cc:82: error: 'sprintf' was not declared in this scope
> make[3]: *** [pic/oct-md5.o] Error 1
> make[3]: Leaving directory `/build/tbm/octave3.0-3.0.1/liboctave'

--- liboctave/oct-md5.cc~	2008-11-07 21:42:05.000000000 +0000
+++ liboctave/oct-md5.cc	2008-11-07 21:42:14.000000000 +0000
@@ -20,6 +20,7 @@
 
 */
 
+#include <cstdio>
 #include <string>
 #include <vector>
 
--- scripts/gethelp.cc~	2008-11-08 05:55:58.000000000 +0000
+++ scripts/gethelp.cc	2008-11-08 05:56:08.000000000 +0000
@@ -24,6 +24,7 @@
 #define __USE_STD_IOSTREAM
 #endif
 
+#include <cstdio>
 #include <string>
 #include <iostream>
 

Unfortunately I'm not sure if this patch is complete because my build
fails with:

g++  -I. -I.. -I../liboctave -I../src -I../libcruft/misc  -DHAVE_CONFIG_H  -Wall -W -Wshadow -Wold-style-cast -g -O2 -rdynamic \
        -L..  -fPIC  -o octave \
        main.o  \
        -L../liboctave -L../libcruft -L../src -Wl,-rpath -Wl,/usr/lib/octave-3.0.1 \
        -loctinterp -loctave  -lcruft   \
         -lumfpack -lamd -lcamd -lcolamd \
        -lcholmod -lccolamd -lcxsparse -llapackgf-3 -lblas-3gf \
        -lfftw3 -lreadline  -lncurses -ldl -lhdf5 -lz -lm  -L/usr/lib/gcc/x86_64-linux-gnu/4.3.2 -L/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../.. -lhdf5 -lz -lgfortranbegin -lgfortran -lm
../src/liboctinterp.so: undefined reference to `std::ctype<char>::_M_widen_init() const'
collect2: ld returned 1 exit status

I'm not sure what this is about.
-- 
Martin Michlmayr
http://www.cyrius.com/





More information about the Pkg-octave-devel mailing list