Bug 290642

Summary: build failed with gcc-4.7.0 [patch]
Product: [Applications] digikam Reporter: nucleo <nucleo>
Component: Portability-CompilationAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, kevin.kofler
Priority: NOR    
Version: 2.5.0   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In: 2.6.0
Sentry Crash Report:
Attachments: Patch that fixes all gcc-4.7.0 related issues

Description nucleo 2012-01-04 23:03:58 UTC
Version:           2.5.0 (using Devel) 
OS:                Linux

digikam-2.5.0 build failed with gcc-4.7.0:

[ 47%] Building CXX object extra/kipi-plugins/common/libkipiplugins/CMakeFiles/kipiplugins.dir/widgets/previewmanager.cpp.o
cd /builddir/build/BUILD/digikam-2.5.0/i686-redhat-linux-gnu/extra/kipi-plugins/common/libkipiplugins && /usr/bin/c++   -DMAKE_KIPIPLUGINS_LIB -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -DQT_NO_STL -DQT_NO_CAST_TO_ASCII -D_REENTRANT -DKDE_DEPRECATED_WARNINGS -DKDE4_CMAKE_TOPLEVEL_DIR_LENGTH=21 -DKDE_DEFAULT_DEBUG_AREA=51000 -DAREA_CODE_GENERAL=51000 -DAREA_CODE_LOADING=51001 -DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4  -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables  -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -DQT_NO_EXCEPTIONS -fno-check-new -fno-common -Woverloaded-virtual -fno-threadsafe-statics -fvisibility=hidden -Werror=return-type -fvisibility-inlines-hidden -O2 -DNDEBUG -DQT_NO_DEBUG -fPIC -I/builddir/build/BUILD/digikam-2.5.0/i686-redhat-linux-gnu/extra/kipi-plugins/common/libkipiplugins -I/builddir/build/BUILD/digikam-2.5.0/extra/kipi-plugins/common/libkipiplugins -I/builddir/build/BUILD/digikam-2.5.0/extra/kipi-plugins/common/libkipiplugins/dialogs -I/builddir/build/BUILD/digikam-2.5.0/i686-redhat-linux-gnu/extra/kipi-plugins/common/libkipiplugins/dialogs -I/builddir/build/BUILD/digikam-2.5.0/extra/kipi-plugins/common/libkipiplugins/widgets -I/builddir/build/BUILD/digikam-2.5.0/i686-redhat-linux-gnu/extra/kipi-plugins/common/libkipiplugins/widgets -I/builddir/build/BUILD/digikam-2.5.0/extra/kipi-plugins/common/libkipiplugins/tools -I/builddir/build/BUILD/digikam-2.5.0/i686-redhat-linux-gnu/extra/kipi-plugins/common/libkipiplugins/tools -I/usr/lib/include/opencv -I/usr/lib/include -I/usr/include/kde4 -I/usr/include/kde4/KDE -I/usr/include/KDE -I/usr/include/phonon -I/usr/include/QtXmlPatterns -I/usr/include/QtXml -I/usr/include/QtWebKit -I/usr/include/QtUiTools -I/usr/include/QtTest -I/usr/include/QtSvg -I/usr/include/QtSql -I/usr/include/QtScriptTools -I/usr/include/QtScript -I/usr/include/QtOpenGL -I/usr/include/QtNetwork -I/usr/include/QtMultimedia -I/usr/include/QtHelp -I/usr/include/QtDesigner -I/usr/include/QtDeclarative -I/usr/include/QtDBus -I/usr/include/Qt3Support -I/usr/include/QtGui -I/usr/include/QtCore -I/usr/include/Qt -I/usr/lib/qt4/mkspecs/default    -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o CMakeFiles/kipiplugins.dir/widgets/previewmanager.cpp.o -c /builddir/build/BUILD/digikam-2.5.0/extra/kipi-plugins/common/libkipiplugins/widgets/previewmanager.cpp
/builddir/build/BUILD/digikam-2.5.0/core/utilities/cameragui/devices/gpcamera.cpp: In member function 'virtual bool Digikam::GPCamera::downloadItem(const QString&, const QString&, const QString&)':
/builddir/build/BUILD/digikam-2.5.0/core/utilities/cameragui/devices/gpcamera.cpp:1075:35: error: 'dup' was not declared in this scope

Reproducible: Didn't try


Actual Results:  
 

Expected Results:
Comment 1 nucleo 2012-01-04 23:12:01 UTC
See full build log here http://nucleo.fedorapeople.org/digikam-gcc-4.7.0.log
Comment 2 Kevin Kofler 2012-01-04 23:14:19 UTC
This needs #include <unistd.h>.
Comment 3 nucleo 2012-01-05 01:37:54 UTC
Created attachment 67471 [details]
Patch that fixes all gcc-4.7.0 related issues

There are other issues that needs not only "#include <unistd.h>" but also adding this->.
Comment 4 caulier.gilles 2012-01-05 08:20:06 UTC
Git commit 4b7be9b72c11503104ba1d3a4843a9b69c76c0e4 by Gilles Caulier.
Committed on 05/01/2012 at 09:16.
Pushed by cgilles into branch 'master'.

apply patch #67471 to compile fine with GCC 4.7.0

M  +1    -1    digikam/album/albummanager.h
M  +2    -2    libs/database/imagehistory/imagehistorygraph_boost.h
M  +1    -0    utilities/cameragui/devices/gpcamera.cpp

http://commits.kde.org/digikam/4b7be9b72c11503104ba1d3a4843a9b69c76c0e4
Comment 5 caulier.gilles 2012-01-05 08:20:13 UTC
Git commit 19e3844535fee6b258ee8c20e8565eb0a231cae9 by Gilles Caulier.
Committed on 05/01/2012 at 09:18.
Pushed by cgilles into branch 'master'.

apply patch #67471 to compile fine with GCC 4.7.0

M  +1    -1    htmlexport/wizard.cpp
M  +1    -1    printimages/wizard/wizard.cpp

http://commits.kde.org/kipi-plugins/19e3844535fee6b258ee8c20e8565eb0a231cae9