【发布时间】:2018-11-14 15:52:34
【问题描述】:
我正在玩 node-gyp 并且我正在尝试通过添加与 hello.cc 相同级别的文件夹 libraries 并简单地添加 @987654325 来将库 muParser 添加到一些示例代码中@到hello.cc。
libraries 具有以下结构:
-include - with files such as muParser.h
-lib - with a single file libmuparser.a
问题是我的binding.gyp 文件没有按照我认为的方式执行以下 2 个变体,相对路径和绝对路径,我得到同样的错误 - ../hello.cc:3:10: fatal error: 'muParser.h' file not found 当我 npm install 时:
{
"targets": [
{
"target_name": "hello",
"sources": [ "hello.cc" ],
"include_dirs": [
"../libraries/include/"
],
"libraries": [
"-llibmuparser', '-L../libraries/lib/"
],
}
]
}
{
"targets": [
{
"target_name": "hello",
"sources": [ "hello.cc" ],
"include_dirs": [
"<(module_root_dir)/../libraries/include/"
],
"libraries": [
"<(module_root_dir)/../libraries/lib/libmuparser.a"
],
}
]
}
谁能解释我如何包含这个库?
【问题讨论】:
标签: node-gyp