[Debian-med-packaging] Bug#505953: FTBFS with GCC 4.4: missing #include

Martin Michlmayr tbm at cyrius.com
Sun Nov 16 17:59:25 UTC 2008


Package: sofa-framework
Version: 1.0~beta3-3
User: debian-gcc at lists.debian.org
Usertags: ftbfs-gcc-4.4
Tags: patch

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 sofa-framework_1.0~beta3-3 on em64t by sbuild/amd64 0.53
...
> g++ -c -pipe -I/usr/include/libxml2 -O2 -D_REENTRANT -Wall -W -fPIC -DSOFA_QT4 -DSOFA_GUI_QTVIEWER -DSOFA_GUI_GLUT -DSOFA_HAVE_GLEW -DNDEBUG -DMINI_FLOWVR -I/usr/share/qt4/mkspecs/linux-g++ -I. -I../../../include -I../../../extlibs -I../../../framework -I/usr/include/qwt -I/usr/include/qt4 -I/usr/include/qwt-qt4 -I/usr/include/libxml2 -I../../../extlibs/qwt -I../../../extlibs/miniFlowVR/include -o OBJ/release/Capture.o gl/Capture.cpp
> gl/Capture.cpp: In member function 'std::string sofa::helper::gl::Capture::findFilename()':
> gl/Capture.cpp:80: error: 'sprintf' was not declared in this scope
> gl/Capture.cpp:92: error: 'sprintf' was not declared in this scope
> make[4]: *** [OBJ/release/Capture.o] Error 1

--- framework/sofa/helper/io/ImageBMP.cpp~	2008-11-14 21:16:38.000000000 +0000
+++ framework/sofa/helper/io/ImageBMP.cpp	2008-11-14 21:16:44.000000000 +0000
@@ -26,6 +26,7 @@
 ******************************************************************************/
 #include <sofa/helper/io/ImageBMP.h>
 #include <sofa/helper/system/FileRepository.h>
+#include <cstdio>
 #include <iostream>
 
 namespace sofa
--- framework/sofa/helper/io/MeshTrian.cpp~	2008-11-14 21:17:24.000000000 +0000
+++ framework/sofa/helper/io/MeshTrian.cpp	2008-11-14 21:17:31.000000000 +0000
@@ -27,6 +27,7 @@
 #include <sofa/helper/io/MeshTrian.h>
 #include <sofa/helper/system/FileRepository.h>
 #include <stdlib.h>
+#include <cstdio>
 #include <iostream>
 #include <string>
 
--- framework/sofa/helper/gl/Capture.cpp~	2008-11-14 21:16:18.000000000 +0000
+++ framework/sofa/helper/gl/Capture.cpp	2008-11-14 21:16:24.000000000 +0000
@@ -30,6 +30,7 @@
 #include <sofa/helper/io/ImagePNG.h>
 #endif
 
+#include <cstdio>
 #include <sys/types.h>
 #include <sys/stat.h>
 
--- framework/sofa/helper/Quater.inl~	2008-11-14 21:18:37.000000000 +0000
+++ framework/sofa/helper/Quater.inl	2008-11-14 21:18:47.000000000 +0000
@@ -28,6 +28,7 @@
 #define SOFA_HELPER_QUATER_INL
 
 #include "Quater.h"
+#include <cstdio>
 #include <math.h>
 #include <iostream>
 

but then I run into:

g++ -Wl,-z,defs -shared -Wl,-soname,libsofaguiqt.so.1 -o libsofaguiqt.so.1.0.0 OBJ/release/Main.o OBJ/release/RealGUI_graph.o OBJ/release/RealGUI_record.o OBJ/release/RealGUI.o OBJ/release/GraphListenerQListView.o OBJ/release/GenGraphForm.o OBJ/release/AddObject.o OBJ/release/DisplayFlagWidget.o OBJ/release/ModifyObject.o OBJ/release/WFloatLineEdit.o OBJ/release/FileManagement.o OBJ/release/QtViewer.o OBJ/release/GUI.o OBJ/release/BaseGenGraphForm.o OBJ/release/DialogAddObject.o OBJ/release/moc_RealGUI.o OBJ/release/moc_GenGraphForm.o OBJ/release/moc_AddObject.o OBJ/release/moc_DisplayFlagWidget.o OBJ/release/moc_ModifyObject.o OBJ/release/moc_WFloatLineEdit.o OBJ/release/moc_QtViewer.o OBJ/release/moc_GUI.o OBJ/release/moc_BaseGenGraphForm.o OBJ/release/moc_DialogAddObject.o  -L../../../../lib/linux -L../../../../lib/linux/../Common -L/usr/share/qt3/lib -lsofahelper -lsofadefaulttype -lsofacore -lsofacomponent -lsofasimulation -lsofatree -lsofagui -lqwt-qt4 -lnewmat -lxml2 -L/usr/X11R6/lib -lglut -lGL -lGLU -lpthread -lX11 -lGLEW -lminiFlowVR -lqt-mt -lpthread
OBJ/release/ModifyObject.o: In function `sofa::gui::qt::ModifyObject::createGraphMass(QTabWidget*)':
/home/tbm/src/sofa-framework-1.0~beta3/applications/sofa/gui/qt/ModifyObject.cpp:1937: undefined reference to `QwtPlot::QwtPlot(QWidget*, char const*)'
collect2: ld returned 1 exit status

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





More information about the Debian-med-packaging mailing list