2

像这样使用 CAPI 时:

// libvlc.h
libvlc_instance_t *libvlc_new (int argc, const char *const *argv)

// VLC.hs
foreign import capi "vlc/libvlc.h libvlc_new" vlcNew :: CInt -> Ptr CString -> IO (Ptr Libvlc)

我收到警告

/tmp/ghc3011_0/ghc3011_0.c: In function ‘ghc_wrapper_d18b_libvlc_new’:

/tmp/ghc3011_0/ghc3011_0.c:10:1:
     warning: passing argument 2 of ‘libvlc_new’ from incompatible pointer type [enabled by default]

In file included from /tmp/ghc3011_0/ghc3011_0.c:7:0: 

/usr/include/vlc/libvlc.h:138:1:
     note: expected ‘const char * const*’ but argument is of type ‘HsInt8 **’

使用时编译干净ccall

这似乎很好,但它仍然是一个警告。我能做些什么吗?

4

0 回答 0