PCL and OSG library conflict

646 views Asked by At

So I am using PCL for point cloud stuff and OpenSceneGraph for visualization. PCL visualization is pretty bad so I made my own. Anyways whenever I try to use this statement

pcl::io::savePCDFileBinary<pcl::PointXYZRGBA>(fname2,*cloud);

things break and I get the following errors

osgDBd.lib(osg80-osgDBd.dll) : error LNK2005: "public: void __thiscall std::basic_ofstream<char,struct std::char_traits<char> >::close(void)" (?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in Recorder.obj
2>osgDBd.lib(osg80-osgDBd.dll) : error LNK2005: "public: void __thiscall std::basic_ofstream<char,struct std::char_traits<char> >::`vbase destructor'(void)" (??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in Recorder.obj
2>osgDBd.lib(osg80-osgDBd.dll) : error LNK2005: "public: bool __thiscall std::basic_ofstream<char,struct std::char_traits<char> >::is_open(void)const " (?is_open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QBE_NXZ) already defined in Recorder.obj
2>osgDBd.lib(osg80-osgDBd.dll) : error LNK2005: "public: void __thiscall std::basic_ofstream<char,struct std::char_traits<char> >::open(char const *,int,int)" (?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBDHH@Z) already defined in Recorder.obj
2>osgDBd.lib(osg80-osgDBd.dll) : error LNK2005: "public: __thiscall std::basic_ofstream<char,struct std::char_traits<char> >::basic_ofstream<char,struct std::char_traits<char> >(void)" (??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@XZ) already defined in Recorder.obj
2>E:\Google Drive\Research\PCL\build\HandTracker\Debug\HandTracker.exe : fatal error LNK1169: one or more multiply defined symbols found

I know that IO files in OSG and PCL are conflicting particularly ostream headers. My question is how do I fix this? I need to use this statement for intermediary files saves, logging, etc. so not using it is out of the question unless I want to use my own method which is kinda like reinventing the wheel.

Thanks for any help

1

There are 1 answers

1
XenonofArcticus On BEST ANSWER

http://forum.openscenegraph.org/viewtopic.php?t=8099

There are several solutions outlined there.