The error message suggests that there is a problem with the declaration of the function callCallback. The correct syntax for declaring a pointer to a C string (*C.char) as a parameter is C.char*. Additionally, the typedef keyword should be used to define a function pointer type, not a function signature.

Here is the corrected code:

typedef void (*Callback)(C.char*);

void callCallback(Callback callback, C.char* s);

In this code, Callback is now a function pointer type that takes a C.char* parameter and returns void. The callCallback function takes a Callback function pointer and a C.char* parameter

typedef void CallbackCchar s;void callCallbackCallback callback Cchar s; error expected declaration specifiers or before token

原文地址: http://www.cveoy.top/t/topic/hXQI 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录