I downloaded the library from roboticslibrary.org to teach myself some C++ and some robotics. I was able to compile it (using cmake and VS2010) for 32bit. My first upgrade to VS2013, 32bit worked fine after upgrading boost. Next I tried to compile it for VS2013 x64 and that's where I am stuck. I was able to build the linker libraries for x64 without any issues and here is the list of libraries being used in this project:
kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib rlmath.lib rlutil.lib rlmdl.lib I have only added the last three libraries in this list, the rest apparently are inherited values which I do not fully understand, so cannot say if they are causing any issues.
I am trying to compile a rather simple sample program and am getting the error output below. At first glance these errors appear to be related to linking, but I get this errors during building, not runtime, so cannot say for certain whether they are linker errors or not.
Please let me know if I need to add more information.
Error Output:
1>------ Build started: Project: rlInversePositionDemo, Configuration: Release x64 ------ 1>rlmdl.lib(XmlFactory.obj) : error LNK2019: unresolved external symbol xmlFreeDoc referenced in function "public: __cdecl rl::xml::Document::Document(struct _xmlDoc *)" (??0Document@xml@rl@@QEAA@PEAU_xmlDoc@@@Z) 1>rlmdl.lib(XmlFactory.obj) : error LNK2019: unresolved external symbol xmlFreeProp referenced in function "public: virtual __cdecl rl::xml::Attribute::~Attribute(void)" (??1Attribute@xml@rl@@UEAA@XZ) 1>rlmdl.lib(XmlFactory.obj) : error LNK2019: unresolved external symbol xmlGetProp referenced in function "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl rl::xml::Attribute::getValue(void)const " (?getValue@Attribute@xml@rl@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) 1>rlmdl.lib(XmlFactory.obj) : error LNK2019: unresolved external symbol xmlHasProp referenced in function "public: class rl::xml::Attribute __cdecl rl::xml::Node::getAttribute(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)const " (?getAttribute@Node@xml@rl@@QEBA?AVAttribute@23@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 1>rlmdl.lib(XmlFactory.obj) : error LNK2019: unresolved external symbol xmlGetLastError referenced in function "public: virtual void __cdecl rl::mdl::XmlFactory::load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class rl::mdl::Model *)" (?load@XmlFactory@mdl@rl@@UEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAVModel@23@@Z) 1>rlmdl.lib(XmlFactory.obj) : error LNK2019: unresolved external symbol xmlCtxtGetLastError referenced in function "public: class rl::xml::Document __cdecl rl::xml::DomParser::readFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int const &)const " (?readFile@DomParser@xml@rl@@QEBA?AVDocument@23@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0AEBH@Z) 1>rlmdl.lib(XmlFactory.obj) : error LNK2019: unresolved external symbol xmlNewParserCtxt referenced in function "public: __cdecl rl::xml::DomParser::DomParser(void)" (??0DomParser@xml@rl@@QEAA@XZ) 1>rlmdl.lib(XmlFactory.obj) : error LNK2019: unresolved external symbol xmlFreeParserCtxt referenced in function "public: __cdecl rl::xml::DomParser::DomParser(void)" (??0DomParser@xml@rl@@QEAA@XZ) 1>rlmdl.lib(XmlFactory.obj) : error LNK2019: unresolved external symbol xmlCtxtReadFile referenced in function "public: class rl::xml::Document __cdecl rl::xml::DomParser::readFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int const &)const " (?readFile@DomParser@xml@rl@@QEBA?AVDocument@23@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0AEBH@Z) 1>rlmdl.lib(XmlFactory.obj) : error LNK2019: unresolved external symbol xmlXIncludeProcessFlags referenced in function "public: virtual void __cdecl rl::mdl::XmlFactory::load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class rl::mdl::Model *)" (?load@XmlFactory@mdl@rl@@UEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAVModel@23@@Z) 1>rlmdl.lib(XmlFactory.obj) : error LNK2019: unresolved external symbol xmlXPathFreeObject referenced in function "public: __cdecl rl::xml::Object::Object(struct _xmlXPathObject *)" (??0Object@xml@rl@@QEAA@PEAU_xmlXPathObject@@@Z) 1>rlmdl.lib(XmlFactory.obj) : error LNK2019: unresolved external symbol xmlXPathNewContext referenced in function "public: __cdecl rl::xml::Path::Path(class rl::xml::Document const &)" (??0Path@xml@rl@@QEAA@AEBVDocument@12@@Z) 1>rlmdl.lib(XmlFactory.obj) : error LNK2019: unresolved external symbol xmlXPathFreeContext referenced in function "public: __cdecl rl::xml::Path::Path(class rl::xml::Document const &)" (??0Path@xml@rl@@QEAA@AEBVDocument@12@@Z) 1>rlmdl.lib(XmlFactory.obj) : error LNK2019: unresolved external symbol xmlXPathEvalExpression referenced in function "public: class rl::xml::Object __cdecl rl::xml::Path::eval(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?eval@Path@xml@rl@@QEAA?AVObject@23@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 1>rlmdl.lib(XmlFactory.obj) : error LNK2019: unresolved external symbol xmlXPathIsNaN referenced in function "public: double __cdecl rl::xml::Object::getFloatval(double const &)const " (?getFloatval@Object@xml@rl@@QEBANAEBN@Z) 1>rlmdl.lib(XmlFactory.obj) : error LNK2019: unresolved external symbol __imp_xmlFree referenced in function "public: virtual __cdecl rl::xml::Node::~Node(void)" (??1Node@xml@rl@@UEAA@XZ) Code Snippet:
#include <iostream> #include <stdexcept> #include <boost/lexical_cast.hpp> #include <boost/shared_ptr.hpp> #include <rl/mdl/Kinematic.h> #include <rl/mdl/XmlFactory.h> #include <rl/math/Unit.h> #include <rl/util/Timer.h> //#define COACH int main(int argc, char** argv) { if (argc < 2) { std::cout << "Usage: rlInversePositionDemo MODELFILE Q1 ... Qn" << std::endl; return 1; } try { srand(static_cast< unsigned int >(rl::util::Timer::now() * 1.0e9f)); rl::mdl::XmlFactory factory; boost::shared_ptr< rl::mdl::Model > model(factory.create(argv[1])); rl::mdl::Kinematic* kinematic = dynamic_cast< rl::mdl::Kinematic* >(model.get()); rl::math::Vector q(kinematic->getDof()); for (std::ptrdiff_t i = 0; i < q.size(); ++i) { q(i) = boost::lexical_cast< rl::math::Real >(argv[i + 2]); } kinematic->setPosition(q); kinematic->forwardPosition(); rl::math::Vector3 position = kinematic->getOperationalPosition(0).translation(); rl::math::Vector3 orientation = kinematic->getOperationalPosition(0).rotation().eulerAngles(2, 1, 0).reverse(); std::cout << "x: " << position.x() << " m, y: " << position.y() << " m, z: " << position.z() << " m, a: " << orientation.x() * rl::math::RAD2DEG << " deg, b: " << orientation.y() * rl::math::RAD2DEG << " deg, c: " << orientation.z() * rl::math::RAD2DEG << " deg" << std::endl; rl::math::Transform x = kinematic->getOperationalPosition(0); kinematic->setPosition(rl::math::Vector::Random(kinematic->getDof())); rl::util::Timer timer; timer.start(); bool result = kinematic->calculateInversePosition(x); timer.stop(); std::cout << (result ? "true" : "false") << " " << timer.elapsed() * 1000 << " ms" << std::endl; kinematic->forwardPosition(); position = kinematic->getOperationalPosition(0).translation(); orientation = kinematic->getOperationalPosition(0).rotation().eulerAngles(2, 1, 0).reverse(); std::cout << "x: " << position.x() << " m, y: " << position.y() << " m, z: " << position.z() << " m, a: " << orientation.x() * rl::math::RAD2DEG << " deg, b: " << orientation.y() * rl::math::RAD2DEG << " deg, c: " << orientation.z() * rl::math::RAD2DEG << " deg" << std::endl; kinematic->getPosition(q); std::cout << "q: " << q.transpose() << std::endl; #ifdef COACH rl::hal::Coach controller(kinematic->getDof(), 0.001f, 0, "localhost"); controller.open(); controller.start(); controller.setJointPosition(q); controller.step(); controller.stop(); controller.close();
No comments:
Post a Comment