开发者社区 问答 正文

如何将Speex编译为供JNI调用的dll文件?

用NDK编译为.so文件没问题
但用MinGW64编译为.dll却各种报错
比如:
screenshot

展开
收起
蛮大人123 2016-03-06 16:28:10 2930 分享 版权
1 条回答
写回答
取消 提交回答
  • 我说我不帅他们就打我,还说我虚伪

    以CDT+MinGW64为例
    在Properties -> C/C++ Build -> Settings -> GCC C Compiler -> Symbols里
    Defined Symbols里添加FIXED_POINT、EXPORT=""、USE_KISS_FFT三项
    在UnDefined Symbols里添加HAVE_CONFIG_H;
    如果你用的是Speex官网下载的文件,需要将include/speex/speex_config_types.h.in的.in去掉,并将内容改为:

    #ifndef __SPEEX_TYPES_H__
    #define __SPEEX_TYPES_H__
    /* these are filled in by configure */
    typedef short spx_int16_t;
    typedef unsigned short spx_uint16_t;
    typedef int spx_int32_t;
    typedef unsigned int spx_uint32_t;
    #endif

    然后可能还会遇到找不到头文件的问题,这个我尝试在项目的Includes里加入include文件夹但没有效果,最后是手动改代码里的路径解决的。

    2019-07-17 18:54:49
    赞同 展开评论
问答地址: