Compilation issue with qt

Nicolas Pavillon nicos at macports.org
Wed Jun 5 09:03:00 PDT 2013


Hello, 

I have an issue with upgrading a port, about which I would like to ask for advice. I looked into upgrading kdevelop and its dependency kdevplatform, and ran into an issue which finally relates to Qt, apparently.

In details, kdevplatform links to grantlee, which appears to have issues with Qt. When compiling, it breaks with messages of the sort:
In file included from /opt/local/var/macports/build/_Users_nicos_ports_local_kde_kdevplatform/kdevplatform/work/kdevplatform-1.5.1/language/codegen/codedescriptionmetatypes.h:25:
In file included from /opt/local/include/grantlee/metatype.h:27:
In file included from /opt/local/include/grantlee/typeaccessor.h:24:
/opt/local/include/grantlee/containeraccessor.h:146:35: error: no matching function for call to 'distance'
  list.reserve( static_cast<int>( std::distance( it, end ) ) );

This error seem to appear because Qt forward-declares random_access_iterator_tag in qiterator.h in the part:
#ifdef QT_NO_STL
namespace std {
    struct bidirectional_iterator_tag;
    struct random_access_iterator_tag;
}
#endif
This declaration overrides the ones in std libraries, so that the compiler does not recognise the code in grantlee as being valid, as reported in http://llvm.org/bugs/show_bug.cgi?id=13925.

The fix proposed in the link above is to patch qiterator.h, by suppressing the forward declarations, and include <iterator> instead. I tested it, and this indeed works. However, it seems rather overreaching to have to patch Qt (a huge port), in order to get kdevelop to compile. Would anyone have another idea ?

Cheers, 

Nicolas

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20130606/5688baa4/attachment.html>


More information about the macports-dev mailing list