You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.
I was trying to encapsulate sick_scan_base for my own lib which uses SickTim561.
I modified 'CMakeLists.txt' for compilation and installing and everything works fine.
However, when i tried '#include <sick_scan/sick_generic_laser.h>', some redefinition errors happen.
Error messages:
1>libboost_system-vc141-mt-x32-1_68.lib(error_code.obj) : error LNK2005: "public: virtual class boost::system::error_condition __thiscall boost::system::detail::system_error_category::default_error_condition(int)const " (?default_error_condition@system_error_category@detail@system@boost@@ube?AVerror_condition@34@H@Z) already defined in sick_scan.lib(rossimu.obj)
1>libboost_system-vc141-mt-x32-1_68.lib(error_code.obj) : error LNK2005: "public: virtual class std::basic_string<char,struct std::char_traits,class std::allocator > __thiscall boost::system::detail::generic_error_category::message(int)const " (?message@generic_error_category@detail@system@boost@@ube?AV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@h@Z) already defined in sick_scan.lib(rossimu.obj)
1>libboost_system-vc141-mt-x32-1_68.lib(error_code.obj) : error LNK2005: "public: virtual class std::basic_string<char,struct std::char_traits,class std::allocator > __thiscall boost::system::detail::system_error_category::message(int)const " (?message@system_error_category@detail@system@boost@@ube?AV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@h@Z) already defined in sick_scan.lib(rossimu.obj)
1>D:\visionnav-libraries\ForkingPerceptionModule2D\out\build32\bin\RelWithDebInfo\LaserDriver.dll : fatal error LNK1169: one or more multiply defined symbols found
Trials:
I tried everything I could come up, including adding "#ifndef #define #endif", but none helped. And I looked up the source code and found some functions may be the source of problems. The functions are like:
void ros::init(int &, char * *, class std::basic_string<char, struct std::char_traits, class std::allocator > const &, unsigned int)
{
Time::init();
}
But I still can't figure out how to solve this problem.
The text was updated successfully, but these errors were encountered:
Thanks for reporting. Since all messages are linker errors, I guess that both sick_scan.lib and other libs/executables are linked against boost libraries. This way symbols defined in the boost library may be defined in other libs, too. If possible, try to link boost libraries only once in your executable (i.e. do not link libraries against boost except the main executable).
Alternatively, you can link with option /FORCE, which forces a link to complete even with unresolved symbols or symbols defined more than once.
Another alternative is to switch to sick_scan_xd, see https://github.com/SICKAG/sick_scan_xd for details. This driver has no boost dependencies and supports both Linux and Windows with or without ROS.
Visual Studio 2019 is recommended for the Windows build. If you're using Visual Studio 2017 (which "libboost_system-vc141" suggests), try upgrading to Visual Studio 2019.
Visual Studio 2019 is recommended for the Windows build. If you're using Visual Studio 2017 (which "libboost_system-vc141" suggests), try upgrading to Visual Studio 2019.
Thank you for your replay. I am using VS 2019 and this "libboost_system-vc141" is a prebuilt lib which is installed from PCL(PCL itself has a boost-1.68 library build by VS 2017.) In fact, when building sick_scan_base, I linked boost-1.68-vc141, and boost-1.78-vc142 for my own lib.
Anyway, I'll try using boost-1.78 built by VS2019 and see if the problem will be solved.
Description:
I was trying to encapsulate sick_scan_base for my own lib which uses SickTim561.
I modified 'CMakeLists.txt' for compilation and installing and everything works fine.
However, when i tried '#include <sick_scan/sick_generic_laser.h>', some redefinition errors happen.
Error messages:
1>libboost_system-vc141-mt-x32-1_68.lib(error_code.obj) : error LNK2005: "public: virtual class boost::system::error_condition __thiscall boost::system::detail::system_error_category::default_error_condition(int)const " (?default_error_condition@system_error_category@detail@system@boost@@ube?AVerror_condition@34@H@Z) already defined in sick_scan.lib(rossimu.obj)
1>libboost_system-vc141-mt-x32-1_68.lib(error_code.obj) : error LNK2005: "public: virtual class std::basic_string<char,struct std::char_traits,class std::allocator > __thiscall boost::system::detail::generic_error_category::message(int)const " (?message@generic_error_category@detail@system@boost@@ube?AV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@h@Z) already defined in sick_scan.lib(rossimu.obj)
1>libboost_system-vc141-mt-x32-1_68.lib(error_code.obj) : error LNK2005: "public: virtual class std::basic_string<char,struct std::char_traits,class std::allocator > __thiscall boost::system::detail::system_error_category::message(int)const " (?message@system_error_category@detail@system@boost@@ube?AV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@h@Z) already defined in sick_scan.lib(rossimu.obj)
1>D:\visionnav-libraries\ForkingPerceptionModule2D\out\build32\bin\RelWithDebInfo\LaserDriver.dll : fatal error LNK1169: one or more multiply defined symbols found
Trials:
I tried everything I could come up, including adding "#ifndef #define #endif", but none helped. And I looked up the source code and found some functions may be the source of problems. The functions are like:
void ros::init(int &, char * *, class std::basic_string<char, struct std::char_traits, class std::allocator > const &, unsigned int)
{
Time::init();
}
But I still can't figure out how to solve this problem.
The text was updated successfully, but these errors were encountered: