我对node.js和node-gyp是个新手,但是我想从一个wscript构建一个模块。据我所知,我需要使用node-waf来直接构建模块,但由于不再支持它,我想从wscript创建一个bindings.gyp。
我的wscript:
import Options
def set_options(opt):
opt.tool_options("compiler_cxx")
def configure(conf):
conf.check_tool("compiler_cxx")
conf.check_tool("node_addon")
conf.env.append_value('LINKFLAGS', ['-l:ail.so', 'L/.../src/',])
def build(bld):
obj = bld.new_task_gen("cxx", "shlib", "node_addon")
obj.target = "AIL"
obj.source = ["AIL.cc","reader.cc"]以及我创建binding.gyp的尝试
{
"targets" : [
{
"target_name": "AIL",
"sources": ["AIL.cc", "reader.cc", "ailreader/src/ali.h"]
}
]
} 该模块将构建,但当我运行它时,它给出了符号查找错误。
发布于 2013-07-03 16:45:06
我错过了库。以下binding.gyp文件工作正常:
{
"targets" : [
{
"target_name": "AIL",
"sources": ["AIL.cc", "reader.cc"],
"link_settings" : {
"libraries":['-l:/path/to/lib/ail.so'],
}
}
]
}https://stackoverflow.com/questions/17346531
复制相似问题