[xsd-users] undefined references after extending the tree
custumization to further types
Klima Georg
G.Klima at durst-online.at
Sat Apr 27 15:58:17 EDT 2013
Hi members,
I'm using tree customisation for some types already without any troubles.
But since I tried to extend the customisation for other types too I do get link erros:
Linking CXX executable schema_test
cd /home/gklima/projects/printerCalibration_build/lib/patternDescriptor/schema && /home/gklima/projects/support_sw/cmake/2.8.10.2/bin/cmake -E cmake_link_script CMakeFiles/schema_test.dir/link.txt --verbose=1
/usr/bin/c++ -fmessage-length=0 -g CMakeFiles/schema_test.dir/schema_test.cpp.o CMakeFiles/schema_test.dir/XAlignDescriptor.cxx.o CMakeFiles/schema_test.dir/PatternDescriptorDT.cxx.o CMakeFiles/schema_test.dir/pd-custom.cpp.o -o schema_test -L/home/gklima/projects/support_sw/log4cplus/1.1.0/lib -L/home/gklima/projects/support_sw/qextserialport/1.2rc/lib -L/opt/halcon11/lib/x64-linux2.4-gcc40 -rdynamic /home/gklima/projects/support_sw/xerces-c/3.1.1/lib/libxerces-c-3.1.so -Wl,-rpath,/home/gklima/projects/support_sw/log4cplus/1.1.0/lib:/home/gklima/projects/support_sw/qextserialport/1.2rc/lib:/opt/halcon11/lib/x64-linux2.4-gcc40:/home/gklima/projects/support_sw/xerces-c/3.1.1/lib
CMakeFiles/schema_test.dir/PatternDescriptorDT.cxx.o: In function `pointLocation_base':
/home/gklima/projects/printerCalibration_build/lib/patternDescriptor/schema/PatternDescriptorDT.cxx:1103: undefined reference to `DPrnCal::location_impl<DPrnCal::location_base>::location_impl()'
/home/gklima/projects/printerCalibration_build/lib/patternDescriptor/schema/PatternDescriptorDT.cxx:1113: undefined reference to `DPrnCal::location_impl<DPrnCal::location_base>::location_impl(DPrnCal::location_impl<DPrnCal::location_base> const&, xsd::cxx::tree::flags, xsd::cxx::tree::_type*)'
/home/gklima/projects/printerCalibration_build/lib/patternDescriptor/schema/PatternDescriptorDT.cxx:1123: undefined reference to `DPrnCal::location_impl<DPrnCal::location_base>::location_impl(xercesc_3_1::DOMElement const&, xsd::cxx::tree::flags, xsd::cxx::tree::_type*)'
/home/gklima/projects/printerCalibration_build/lib/patternDescriptor/schema/PatternDescriptorDT.cxx:1123: undefined reference to `DPrnCal::location_impl<DPrnCal::location_base>::~location_impl()'
CMakeFiles/schema_test.dir/PatternDescriptorDT.cxx.o: In function `~pointLocation_base':
/home/gklima/projects/printerCalibration_build/lib/patternDescriptor/schema/PatternDescriptorDT.cxx:1178: undefined reference to `DPrnCal::location_impl<DPrnCal::location_base>::~location_impl()'
CMakeFiles/schema_test.dir/PatternDescriptorDT.cxx.o: In function `roiLocation_vt':
/home/gklima/projects/printerCalibration_build/lib/patternDescriptor/schema/PatternDescriptorDT.cxx:1202: undefined reference to `DPrnCal::location_impl<DPrnCal::location_base>::location_impl()'
/home/gklima/projects/printerCalibration_build/lib/patternDescriptor/schema/PatternDescriptorDT.cxx:1216: undefined reference to `DPrnCal::location_impl<DPrnCal::location_base>::location_impl(DPrnCal::location_impl<DPrnCal::location_base> const&, xsd::cxx::tree::flags, xsd::cxx::tree::_type*)'
/home/gklima/projects/printerCalibration_build/lib/patternDescriptor/schema/PatternDescriptorDT.cxx:1230: undefined reference to `DPrnCal::location_impl<DPrnCal::location_base>::location_impl(xercesc_3_1::DOMElement const&, xsd::cxx::tree::flags, xsd::cxx::tree::_type*)'
/home/gklima/projects/printerCalibration_build/lib/patternDescriptor/schema/PatternDescriptorDT.cxx:1230: undefined reference to `DPrnCal::location_impl<DPrnCal::location_base>::~location_impl()'
CMakeFiles/schema_test.dir/PatternDescriptorDT.cxx.o: In function `~roiLocation_vt':
/home/gklima/projects/printerCalibration_build/lib/patternDescriptor/schema/PatternDescriptorDT.cxx:1333: undefined reference to `DPrnCal::location_impl<DPrnCal::location_base>::~location_impl()'
CMakeFiles/schema_test.dir/PatternDescriptorDT.cxx.o: In function `std::auto_ptr<xsd::cxx::tree::_type> xsd::cxx::tree::factory_impl<DPrnCal::pointLocation_impl<DPrnCal::pointLocation_base> >(xercesc_3_1::DOMElement const&, xsd::cxx::tree::flags, xsd::cxx::tree::_type*)':
/home/gklima/projects/support_sw/xsd/3.3.0-2/include/xsd/cxx/tree/type-factory-map.txx:434: undefined reference to `DPrnCal::pointLocation_impl<DPrnCal::pointLocation_base>::pointLocation_impl(xercesc_3_1::DOMElement const&, xsd::cxx::tree::flags, xsd::cxx::tree::_type*)'
CMakeFiles/schema_test.dir/PatternDescriptorDT.cxx.o: In function `std::auto_ptr<xsd::cxx::tree::_type> xsd::cxx::tree::factory_impl<DPrnCal::location_impl<DPrnCal::location_base> >(xercesc_3_1::DOMElement const&, xsd::cxx::tree::flags, xsd::cxx::tree::_type*)':
/home/gklima/projects/support_sw/xsd/3.3.0-2/include/xsd/cxx/tree/type-factory-map.txx:434: undefined reference to `DPrnCal::location_impl<DPrnCal::location_base>::location_impl(xercesc_3_1::DOMElement const&, xsd::cxx::tree::flags, xsd::cxx::tree::_type*)'
collect2: ld gab 1 als Ende-Status zurück
make[2]: *** [lib/patternDescriptor/schema/schema_test] Fehler 1
make[2]: Verlasse Verzeichnis '/home/gklima/projects/printerCalibration_build'
make[1]: *** [lib/patternDescriptor/schema/CMakeFiles/schema_test.dir/all] Fehler 2
make[1]: Verlasse Verzeichnis '/home/gklima/projects/printerCalibration_build'
make: *** [all] Fehler 2
xsd options:
--generate-polymorphic
--polymorphic-type-all
--custom-type location_at=location_impl<location_base>/location_base
--custom-type pointLocation_vt=pointLocation_impl<pointLocation_base>/pointLocation_base
--generate-forward
--fwd-prologue #include "pd-custom-fwd.hpp"
--hxx-prologue #include "pd-custom.hpp"
FILE pd-custom-fwd.hpp:
namespace DPrnCal {
//template <typename base> class xalignDescriptor_impl;
//template <typename base> class xalignReference_impl;
//template <typename base> class xalignMeasurement_impl;
//template <typename base> class pointLocation_impl;
//template <typename base> class roiLocation_impl;
//template <typename base> class droplet_impl;
//template <typename base> class dropletSegment_impl;
//template <typename base> class segment_impl;
//template <typename base> class simpleFrame_impl;
//template <typename base> class doubleFrame_impl;
//template <typename base> class frameReference_impl;
//template <typename base> class patternDescriptor_impl;
template <typename base> class location_impl;
template <typename base> class pointLocation_impl;
} // namespace DPrnCal
FILE pd-custom.hpp:
#include "PatternDescriptorDT-fwd.hxx"
namespace DPrnCal {
template <typename base> class location_impl: public base
{
public:
location_impl ();
location_impl (const ::xercesc::DOMElement& e,
::xml_schema::flags f = 0,
::xml_schema::container* c = 0);
location_impl (const ::xercesc::DOMAttr& a,
::xml_schema::flags f = 0,
::xml_schema::container* c = 0);
location_impl (const ::std::string& s,
const ::xercesc::DOMElement* e,
::xml_schema::flags f = 0,
::xml_schema::container* c = 0);
location_impl (const location_impl& x,
::xml_schema::flags f = 0,
::xml_schema::container* c = 0);
virtual location_impl*
_clone (::xml_schema::flags f = 0,
::xml_schema::container* c = 0) const;
virtual
~location_impl ();
};
template <typename base> class pointLocation_impl: public base
{
public:
pointLocation_impl (typename base::x_type const &,
typename base::yIdx_type const &);
pointLocation_impl (const ::xercesc::DOMElement& e,
::xml_schema::flags f = 0,
::xml_schema::container* c = 0);
pointLocation_impl (const pointLocation_impl& x,
::xml_schema::flags f = 0,
::xml_schema::container* c = 0);
virtual pointLocation_impl*
_clone (::xml_schema::flags f = 0,
::xml_schema::container* c = 0) const;
virtual
~pointLocation_impl ();
};
} /* namespace DPrnCal */
FILE pd-custorm.cpp
#include "pd-custom.hpp"
namespace DPrnCal {
template <typename base> location_impl<base>::location_impl():base(){}
template <typename base> location_impl<base>::location_impl (const ::xercesc::DOMElement& e,
::xml_schema::flags f ,
::xml_schema::container* c):base(e,f,c) {}
template <typename base> location_impl<base>::location_impl (const ::xercesc::DOMAttr& a,
::xml_schema::flags f ,
::xml_schema::container* c ):base(a,f,c) {}
template <typename base> location_impl<base>::location_impl (const ::std::string& s,
const ::xercesc::DOMElement* e,
::xml_schema::flags f,
::xml_schema::container* c):base(e,f,c) {}
template <typename base> location_impl<base>::location_impl (const location_impl<base>& x,
::xml_schema::flags f,
::xml_schema::container* c):base(x,f,c) {}
template <typename base> location_impl<base> * location_impl<base>::_clone (::xml_schema::flags f,
::xml_schema::container* c) const
{
return new location_impl(*this, f,c);
}
template <typename base> location_impl<base>::~location_impl () {}
//--------------------------------------------------------------------------------------------------------
template <typename base> pointLocation_impl<base>::pointLocation_impl ( typename base::x_type const & a,
typename base::yIdx_type const & b):base(a,b){}
template <typename base> pointLocation_impl<base>::pointLocation_impl (const ::xercesc::DOMElement& e,
::xml_schema::flags f,
::xml_schema::container* c):base(e,f,c){}
template <typename base> pointLocation_impl<base>::pointLocation_impl (const pointLocation_impl<base>& x,
::xml_schema::flags f,
::xml_schema::container* c):base(x,f,c){}
template <typename base> pointLocation_impl<base> * pointLocation_impl<base>::_clone (::xml_schema::flags f,
::xml_schema::container* c) const {
return pointLocation_impl(*this, f,c);
}
template <typename base> pointLocation_impl<base>::~pointLocation_impl () {}
} /* namespace DPrnCal */
If I remove the pointLocation customisation there are no errors anymore!!!!!!!
Be aware I remove pointLocation and not location for which link errors existed. But then the errors are gone!
gcc-Version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
Please, I don't have any clue what I'm doing wrong!
Best regards
Georg
More information about the xsd-users
mailing list