[Kde-bindings] [Bug 103988] smoke bindings compile error on Solaris

Richard Dale Richard_Dale at tipitina.demon.co.uk
Sat Apr 16 10:57:03 UTC 2005


On Saturday 16 April 2005 10:10, David Faure wrote:
> ------- You are receiving this mail because: -------
> You are the assignee for the bug, or are watching the assignee.
>
> http://bugs.kde.org/show_bug.cgi?id=103988
>
>
>
>
> ------- Additional Comments From faure kde org  2005-04-16 12:10 -------
>
> > I really can't see any use for being able to convert between QStrings and
> > std::strings in a language binding
>
> Right. But the fix also removes any method that takes a std::string - even
> one where there would be no QString equivalent for the method... In Qt/KDE
> this is unlikely, just wondering about people who would want to use smoke
> to wrap other libs. I wonder if a missing #include <string> was the
> problem.
Yes, in qstring.h '<string>' is only included if QT_NO_STL wasn't defined:

#ifndef QT_NO_STL
#if defined ( Q_CC_MSVC_NET ) && _MSV_VER < 1310 // Avoids nasty warning for 
xlocale, line 450
#  pragma warning ( push )
#  pragma warning ( disable : 4189 )
#  include <string>
#  pragma warning ( pop )
#else
#  include <string>
#endif
#if defined(Q_WRONG_SB_CTYPE_MACROS) && defined(_SB_CTYPE_MACROS)
#undef _SB_CTYPE_MACROS
#endif
#endif

Then the two concatenate methods were defined:

#ifndef QT_NO_STL
Q_EXPORT inline const QString operator+(const QString& s1, const std::string& 
s2)
{
    return s1 + QString(s2);
}

Q_EXPORT inline const QString operator+(const std::string& s1, const QString& 
s2)
{
    QString tmp(s2);
    return QString(tmp.prepend(s1));
}
#endif

So kalyptus wasn't skipping over the '#ifndef QT_NO_STL', and was including 
the concatenate methods. So I'll fix kalyptus so it skips over the #ifndef 
instead just ditching any method with a std::string arg type.

A better fix would be to include a configuration check for whether or not Qt 
had been built with STL support or not, and conditionally skip stuff like the 
above.

-- Richard



More information about the Kde-bindings mailing list