C++: Linking issue when using dynamic libraries #1202
-
I am using MCAP within my codebase and have run into a linking issue when I am trying to include the reader/writer within header files. Until now I could prevent such issues by defining the
I am using MSVC 17.9.7 with conan and cmake I could not find any thing in the documentation how to fix this? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
Hi @SonnleitnerF - We recently added a link in the docs to a community repo which can help smooth CMake integration: olympus-robotics/mcap_builder. In the readme, they note:
Curious if this might help with your use-case? |
Beta Was this translation helpful? Give feedback.
-
MCAP_IMPLEMENTATION is supposed to be defined in only one translation unit, it should not be defined globally. |
Beta Was this translation helpful? Give feedback.
-
I now resolved this issue by prebuilding mcap and linking against it. This way the macro is not needed anymore and no linker issues occur. I leave the discussion open for other potential solutions, if other developers experiencing similar issues can have different approaches |
Beta Was this translation helpful? Give feedback.
I now resolved this issue by prebuilding mcap and linking against it. This way the macro is not needed anymore and no linker issues occur.
I leave the discussion open for other potential solutions, if other developers experiencing similar issues can have different approaches