ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
![]() | 1 | initial version |
Isn't this just a regular C++ mangles C symbols but the library exports non-mangled symbols?
Is the waveshare lib plain C, or does it use C++? If the former, you need to enclose the #include
s of the waveshare's headers with extern "C" { ... }
, to prevent the C++ compiler from mangling all the function names and the linker then not being able to find them in the library.
Note: this is not special or specific to ROS 2, it's always a problem when linking C with C++.
![]() | 2 | No.2 Revision |
Isn't this just a regular C++ mangles C symbols but the library exports non-mangled
symbols?symbols problem?
Is the waveshare lib plain C, or does it use C++? If the former, you need to enclose the #include
s of the waveshare's headers with extern "C" { ... }
, to prevent the C++ compiler from mangling all the function names and the linker then not being able to find them in the library.
Note: this is not special or specific to ROS 2, it's always a problem when linking C with C++.
![]() | 3 | No.3 Revision |
Isn't this just a regular C++ mangles C symbols but the library exports non-mangled symbols
problem?
Is the waveshare lib plain C, or does it use C++? If the former, you need to enclose the #include
s of the waveshare's headers with extern "C" { ... }
, to prevent the C++ compiler from mangling all the function names and the linker then not being able to find them in the library.
Note: this is not special or specific to ROS 2, it's always a problem when linking C with C++.