Node-gyp Include and Library Directories with Boost

雨燕双飞 提交于 2019-12-31 13:46:54

问题


I'm attempting to build a Node C++ addon on my Windows 7 machine that uses some classes from the Boost libraries. However, after running

node-gyp configure

successfully, I'm continually assaulted by missing header files when I run

node-gyp build

relating to various Boost headers I included.

I tried setting up the include and library directories manually in the Visual Studio projects created by "configure," but to no avail.

How exactly does one go about defining include directories for node-gyp?

[Edit] After messing around with node-gyp with little success, I explored into building Node modules through Visual Studio instead and, turns out, after several hours, it's finally up and working. Thanks for the assistance.


回答1:


You need to add them in the binding.gyp file:

'include_dirs': [
  '<some directory>',
],
'libraries': [
  '-l<some library>', '-L<some library directory>'
]


来源:https://stackoverflow.com/questions/16215082/node-gyp-include-and-library-directories-with-boost

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!