DynamixelSDK icon indicating copy to clipboard operation
DynamixelSDK copied to clipboard

C++ Library design issue

Open santdiego opened this issue 6 years ago • 3 comments

Hi. I'm getting troubles compiling the library in different Ide's. For example, if I compile the dll on Visual Studio I cannot use it in QtCreator project. Even more, If I compile the dll on QtCreator and I use it on Qt project it doesn't work correctly ( on MSVC2017 64bit or MinGW32bit is the same). The only way that works correctly is if the library and the project are compiled with the same compiler (using Visual Studio) in the same machine; other combination may not work. I think the problem relies on the header of the library ( dynamixel_sdk.h and its dependencies). It's manifested on warning C4251 which is getting in any project compilation using this library. The solution is to use d-pointers; I suggest this link to understand the problem: https://wiki.qt.io/D-Pointer

santdiego avatar Nov 29 '18 16:11 santdiego

Hi, @santdiego :) Thanks for your contribution. Actually, DynamixelSDK is optimized for visual studio. We will check it and try to solve it.

Thanks, Gilbert

kijongGil avatar Nov 30 '18 05:11 kijongGil

@kijongGil How is this update going?

HPaper avatar Jan 29 '19 01:01 HPaper

Since this problem affects the portability of the library, and also requires recompiling the library and all the dependent units each time a source code change is made, I see no advantage in maintaining a dynamic library structure. I would strongly recommend migrating to a "header only" structure, since it facilitates the compiling and configuring process, and also generates highly optimized binaries.

santdiego avatar Feb 11 '19 22:02 santdiego