Version: (using KDE KDE 3.3.2) Installed from: Compiled From Sources Compiler: MIPSpro Compilers: Version 7.4.3m OS: Irix I'm encountering the following build problem with the SGI C++ compiler on IRIX for kmail from kdepim-3.3.2: CC -DHAVE_CONFIG_H -I. -I. -I.. -I../libkdenetwork -I../libkdepim -I../libkpimidentities -I../libksieve -I../mimelib -I../certmanager/lib -I.. -I/opt/TWWfsw/libgpgme10/include -I/opt/TWWfsw/libgpgerror10/include -I/opt/TWWfsw/kde33/include -I/opt/TWWfsw/libqt33/include -I/opt/TWWfsw/jpeg/include -I/opt/TWWfsw/libpng12/include -I/opt/TWWfsw/libtiff35/include -I/opt/TWWfsw/libmng10/include -I/opt/TWWfsw/zlib11/include -DQT_THREAD_SUPPORT -DNDEBUG -DNO_DEBUG -Wl,-woff,84 -Wl,-woff,85 -woff 1429 -use_readonly_const -G0 -rdata_shared -DEBUG:optimize_space=ON -mips4 -r5000 -O1 -OPT:Olimit=0 -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -c urlhandlermanager.cpp -DPIC -o .libs/urlhandlermanager.o cc-1278 CC: ERROR File = urlhandlermanager.cpp, Line = 155 No instance of function template "std::for_each" matches the argument list. The argument types are: (QValueVector<const KMail::Interface::BodyPartURLHandler *>::iterator, QValueVector<const KMail::Interface::BodyPartURLHandler *>::iterator, <unknown-type>). for_each( mHandlers.begin(), mHandlers.end(), ^ cc-1278 CC: ERROR File = urlhandlermanager.cpp, Line = 255 No instance of function template "std::for_each" matches the argument list. The argument types are: (QValueVector<const KMail::URLHandler *>::iterator, QValueVector<const KMail::URLHandler *>::iterator, <unknown-type>). for_each( mHandlers.begin(), mHandlers.end(), ^
Was your Qt built with STL support enabled?
Yes, we built with -stl. I've attached a patch that worked around the issue for us by using something similar to what kdepim-3.2.3 used for Delete. Does it make sense (I'm not a C++ guy)?
Created an attachment (id=9949) [details] Workaround
CVS commit by faure: Patch from #100725 to fix build problem on IRIX. Approved by Marc Mutz. BUG: 100725 M +2 -1 rulewidgethandlermanager.cpp 1.15 M +3 -3 stl_util.h 1.4 M +2 -2 urlhandlermanager.cpp 1.19 --- kdepim/kmail/rulewidgethandlermanager.cpp #1.14:1.15 @@ -210,5 +210,6 @@ KMail::RuleWidgetHandlerManager::RuleWid KMail::RuleWidgetHandlerManager::~RuleWidgetHandlerManager() { - for_each( mHandlers.begin(), mHandlers.end(), DeleteAndSetToZero<RuleWidgetHandler> ); + for_each( mHandlers.begin(), mHandlers.end(), + DeleteAndSetToZero<RuleWidgetHandler>() ); } --- kdepim/kmail/stl_util.h #1.3:1.4 @@ -34,7 +34,7 @@ template <typename T> -static inline void DeleteAndSetToZero( const T* & t ) { - delete t; t = 0; -} +struct DeleteAndSetToZero { + void operator()( const T * t ) { delete t; t = 0; } +}; template <typename T> --- kdepim/kmail/urlhandlermanager.cpp #1.18:1.19 @@ -154,5 +154,5 @@ private: KMail::URLHandlerManager::BodyPartURLHandlerManager::~BodyPartURLHandlerManager() { for_each( mHandlers.begin(), mHandlers.end(), - DeleteAndSetToZero<Interface::BodyPartURLHandler> ); + DeleteAndSetToZero<Interface::BodyPartURLHandler>() ); } @@ -254,5 +254,5 @@ KMail::URLHandlerManager::URLHandlerMana KMail::URLHandlerManager::~URLHandlerManager() { for_each( mHandlers.begin(), mHandlers.end(), - DeleteAndSetToZero<URLHandler> ); + DeleteAndSetToZero<URLHandler>() ); }
CVS commit by faure: Add missing &... CCBUG: 100725 M +1 -1 stl_util.h 1.3.2.2 --- kdepim/kmail/stl_util.h #1.3.2.1:1.3.2.2 @@ -35,5 +35,5 @@ template <typename T> struct DeleteAndSetToZero { - void operator()( const T * t ) { delete t; t = 0; } + void operator()( const T * & t ) { delete t; t = 0; } };
You need to log in before you can comment on or make changes to this bug.