新手问题 关于 SWIG 怎么加载 C 函数的问题

nameofhsw · 2016年03月17日 · 最后由 luikore 回复于 2016年04月17日 · 1396 次阅读

在自定义的 C 函数里面使用了 memset,strcpy 这些函数,然后 make 的时候提示错误: ‘memset’was not declared in this scope

在自定义的 C 文件里面有添加对应的头文件,extconf.rb 内容如下:

# Loads mkmf which is used to make makefiles for Ruby extensions
require 'mkmf'

# The destination
dir_config 'sdsapi'

$libs = append_library $libs,'stdc++'

# Do the work
create_makefile 'sdsapi'

有哪位知道问题所在吗?

swig -c++ 编译的么?#include <cstring>

需要 登录 后方可回复, 如果你还没有账号请 注册新账号