opentrack icon indicating copy to clipboard operation
opentrack copied to clipboard

Issue Compiling and using freetrackclient.c

Open Nive4315 opened this issue 4 months ago • 1 comments

Hi, I'm currently trying to compile a copy of freetrackclient.c within my own application so I can access the live data; however, I'm running into an issue. While including the freetrackclient.c and ftttypes.h in my own code file, I get the following error with memcpy (see below).

freetrackclient.c, line 79,

Severity Code Description Error C2664 'void *memcpy(void *,const void *,size_t)': cannot convert argument 1 from 'FTData *' to 'void *'

I'm not sure if there's an issues with the code or if I'm doing something boneheaded (I'm fairly new to C++, so probably the later!!!) I'd appreciate any guidance in resolving the issue.

Nive4315 avatar Feb 14 '24 00:02 Nive4315

The MSVC error message doesn't make sense in C or C++ modes. Maybe the switch -std:c11 can help you.

In any case, add (void*) before the first argument, as such:

memcpy((void*)data, &ipc_heap->data, sizeof(FTData));

sthalik avatar Feb 14 '24 12:02 sthalik