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

nameofhsw · March 17, 2016 · Last by luikore replied at April 17, 2016 · 1397 hits

在自定义的 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>

You need to Sign in before reply, if you don't have an account, please Sign up first.