我正在尝试使用hxcpp编译本机库,但出现此错误:
test.cpp:15:16: error: no matching function for call to 'foo'
DEFINE_PRIME1v(foo);
^~~
/media/Archivos/Lib/haxe/hxcpp/4,0,4/include/hx/CFFIPrime.h:603:41: note:
expanded from macro 'DEFINE_PRIME1v'
value func##__wrap(PRIME_ARG_DECL1) { func(PRIME_ARG_LIST1); return al...
^~~~
test.cpp:11:6: note: candidate function not viable: no known conversion from
'cffi::AutoValue' to 'uint8_t *' (aka 'unsigned char *') for 1st argument
void foo(uint8_t *data)
^
1 error generated.
我理解这是由于参数类型引起的,但我不知道如何解决这个问题。
这是我正在做的最小示例,并且会产生相同的错误。
test.cpp
#ifndef STATIC_LINK
#define IMPLEMENT_API
#endif
#include <cstdint>
#include <hxcpp.h>
#include <hx/CFFIPrime.h>
void foo(uint8_t *data)
{
printf("%x\n", data[0]);
}
DEFINE_PRIME1v(foo);