I am trying to control Dynamixel servos using a GUI made using Qt. Dynamixel provides a C set of C libraries to control the motors, while the only way of making GUI\'s I kno
You can use C libraries from C++... however there are some caveats.
One big thing to watch out when using third-party C libraries with C++ is error handling.
Some C libraries use facilities like setjmp
/longjmp
for error handling. (lua is a notable example). This means that on error stack unwinding will not occur in the normal manner, and you may leak resources. Things like the usual C++ RAII style guards for resource protection fail dismally. (These calls are worse than goto
for C++ code).
Also exceptions can be a concern. If a C++ exception propagates to a C/C++ boundary then the application may terminate rather than propagating the exception. (Depending on how the C library was compiled and your OS etc.) (You might get this situation if you pass a C++ function into a C library as a callback.)