Closed Andrey1994 closed 4 years ago
WIP Code: https://github.com/brainflow-dev/brainflow/tree/oymotion/third_party/gForceSDKCXX if you want to reproduce it locally. I've taken lib and dll files from master branch of this repo.
I wanna add a wrapper dll on top of gforce lib which will push data to a queue and use this wrapper to integrate this device to BrainFlow(https://github.com/brainflow-dev/brainflow)
Checked exported functions, there is such method:
But it looks like c++ name mangling issue... If you look at linking error and at found symbol you will notice that they do not match
In error which I have basic_string@DU?$char_traits@D
in exported symbols basic_string@_WU?$char_traits@_W@std@@V?
.
I think there is one reliable way to fix it - drop HubManager class and add plain C method(wo classes) to return an instance of Hub object, and add
#ifdef __cplusplus
extern "C"
{
#endif
with declspec(dllexport) in front of method and cdecl calling convention
Can you do it?
I've found a clue for this issue - in your vs solution you use character set Unicode while by default in Cmake its different. It leads to different name mangling. Compiles fine with charset unicode.
But I still think that it would be much better if you provide a plain C method to create Hub object and it will prevent issues like this.
Thank you, Andrey1994. gForceSDKCXX is intended for C++ based programs. But it's resonable that we offer a wrapped C lib.
Hello,
I am using Cmake instead VS solution to build my dll on top of gforce lib and getting linker error:
But I linked gforce lib, linker cmd:
As you can see there is
..\lib\gforce64.lib
Am I missing smth? It looks like unimplemented method in lib.I use VS 2017, target windows sdk 8.1