2015-06-17 96 views
1

我試圖用 「楠」 模塊從node.js的如何定位從節點GYP

調用MQ_CONNECT()查看

Node.js and C/C++ integration: how to properly implement callbacks?https://github.com/nodejs/nan

'imqi.hpp'

當我使用「node-gyp」時,它說它找不到「imqi.hpp」,MQ頭文件

據我所知,包含MQ的路徑必須在「binding.gyp」中提供, ,而我已經嘗試過這一切都沒有成功:

{ 
    "targets": [ 
      { 
        "target_name": "mqconn", 
        "sources": [ 
          "initall.cc", 
          "mqconn.cc" 
        ], 
        "include_dirs": [ 
          "<!(node -e \"require('nan')\")", 
          "c:\MQ\tools\cplus\include" 
        ] 
      } 
    ] 
} 

是否anyboby有關於如何解決這個問題的線索? 塞巴斯蒂安。

當然PD.-,該文件是在路徑指示:

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 

回答

1

由於binding.gyp是在JSON,字符串"c:\MQ\tools\cplus\include"是標準的JavaScript字符串,並進行轉義因此\需要到\\

所以你應該把"c:\MQ\tools\cplus\include"換成"c:\\MQ\\tools\\cplus\\include"。我希望能解決這個問題...