如何从node-gyp定位'imqi.hpp'
我正尝试使用“nan”模块从node.js调用MQ_CONNECT()
看到
Node.js和C / C ++的集成:如何正确实现callback? 和https://github.com/nodejs/nan
当我使用“node-gyp”时,它说它找不到“imqi.hpp”,即MQ头
据我所见,MQ的path必须在“binding.gyp”中提供,而我试过这个没有成功:
{ "targets": [ { "target_name": "mqconn", "sources": [ "initall.cc", "mqconn.cc" ], "include_dirs": [ "<!(node -e \"require('nan')\")", "c:\MQ\tools\cplus\include" ] } ] }
anyboby有一个线索如何解决这个问题? 塞巴斯蒂安。
PD.-当然,该文件是path指示的地方:
c:\>dir c:\MQ\tools\cplus\include\imqi.hpp Volume in drive C is OS Volume Serial Number is 12AA-0601 Directory of c:\MQ\tools\cplus\include 27/06/2013 02:00 1.538 imqi.hpp
因为binding.gyp在JSON中,string"c:\MQ\tools\cplus\include"
是一个标准的JavaScriptstring,所以\
需要被转义为\\
。
所以你应该把"c:\MQ\tools\cplus\include"
replace成"c:\\MQ\\tools\\cplus\\include"
。
我希望能解决这个问题