Skip to content
This repository was archived by the owner on Mar 8, 2023. It is now read-only.
This repository was archived by the owner on Mar 8, 2023. It is now read-only.

Redefinition problems when trying to use 'sick_scan_base' for other libs. #15

Open
@ceezous

Description

@ceezous

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions