xtim
Wednesday, August 20, 2008
 
OpenSAML 2 compilation
Compilation of OpenSAML 2.1 is failing on my linux machine with


make[2]: Entering directory `/home/exact/shibuild/opensaml-2.1/saml'
if /bin/sh ../libtool --silent --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/opt/shibboleth-sp/include -pthread -Wall -O2 -DNDEBUG -I/usr/kerberos/include -pthread -Wall -O2 -DNDEBUG -MT SAMLConfig.lo -MD -MP -MF ".deps/SAMLConfig.Tpo" -c -o SAMLConfig.lo SAMLConfig.cpp; \
then mv -f ".deps/SAMLConfig.Tpo" ".deps/SAMLConfig.Plo"; else rm -f ".deps/SAMLConfig.Tpo"; exit 1; fi
In file included from saml2/core/Protocols.h:26,
from SAMLConfig.cpp:47:
../saml/saml2/core/Assertions.h: In static member function `static
opensaml::saml2::Condition*
opensaml::saml2::ConditionBuilder::buildCondition(const
xmltooling::QName&)':
../saml/saml2/core/Assertions.h:480: cannot convert `
opensaml::saml2::Statement*' to `opensaml::saml2::Condition*' in return


and a similar error in saml/saml2/core/Assertions.h .

Looking at the code I can't see why you'd expect it to work - though it's been a while since I've done much C so I'm definitely missing something subtle!

The lines are

            static Condition* buildCondition(const xmltooling::QName& schemaType) {
const ConditionBuilder* b = dynamic_cast<const ConditionBuilder*>(
XMLObjectBuilder::getBuilder(xmltooling::QName(samlconstants::SAML1_NS,Condition::LOCAL_NAME))
);
if (b) {
#ifdef HAVE_COVARIANT_RETURNS
return b->buildObject(samlconstants::SAML1_NS, Condition::LOCAL_NAME, samlconstants::SAML1_PREFIX, &schemaType);
#else
return dynamic_cast<Statement*>(b->buildObject(samlconstants::SAML1_NS, Condition::LOCAL_NAME, samlconstants::SAML1_PREFIX, &schemaType));
#endif
}
throw xmltooling::XMLObjectException("Unable to obtain typed builder for Condition.");
}


so it looks as if it's trying to cast the return value to a Statement* before handing it back as a Condition*. I'm changing the dynamic_cast instruction to match the declared return type and crossing my fingers - I can't see any discussions about this on the web so I must be missing something.

T

Labels: ,


Comments: Post a Comment

<< Home

Powered by Blogger