I'm currently using the CycloneDDS C API in a C++ project. However, I seem to get link errors due undefined references to MODULE_TOPIC_desc.
This can be reproduced quite easily in the helloworld example by:
(1) renaming publisher.c and subscriber.c to publisher.cpp and subscriber.cpp respectively,
(2) changing LANGUAGES at the top of CMakeLists.txt from C to CXX,
(3) renaming publisher.c and subscriber.c in CMakeLists.txt to publisher.cpp and subscriber.cpp
When building this example with CMake, you should get an error similar to the below:
/usr/bin/ld: CMakeFiles/HelloworldPublisher.dir/publisher.cpp.o: in function 'main': publisher.cpp:(.text+0x96): undefined reference to 'HelloWorldData_Msg_desc' collect2: error: ld returned 1 exit status
Perhaps this is a feature rather than a bug. If it is, any thoughts about how I might use CycloneDDS in a C++ project without building/using the C++ bindings would be helpful.
I'm currently using the CycloneDDS C API in a C++ project. However, I seem to get link errors due undefined references to MODULE_TOPIC_desc.
This can be reproduced quite easily in the helloworld example by: (1) renaming publisher.c and subscriber.c to publisher.cpp and subscriber.cpp respectively, (2) changing LANGUAGES at the top of CMakeLists.txt from C to CXX, (3) renaming publisher.c and subscriber.c in CMakeLists.txt to publisher.cpp and subscriber.cpp
When building this example with CMake, you should get an error similar to the below:
/usr/bin/ld: CMakeFiles/HelloworldPublisher.dir/publisher.cpp.o: in function 'main': publisher.cpp:(.text+0x96): undefined reference to 'HelloWorldData_Msg_desc' collect2: error: ld returned 1 exit status
Perhaps this is a feature rather than a bug. If it is, any thoughts about how I might use CycloneDDS in a C++ project without building/using the C++ bindings would be helpful.