Sebastia.Net Sebastia.Net - 1 year ago 114
C++ Question

how to locate 'imqi.hpp' from node-gyp

I am trying to use "nan" module to call MQ_CONNECT() from node.js


Node.js and C/C++ integration: how to properly implement callbacks?

When I use "node-gyp" it says it can not find "imqi.hpp", the MQ header

As far as I can see, the path to MQ includes has to be provided in "binding.gyp", and I have tried this without success:

"targets": [
"target_name": "mqconn",
"sources": [
"include_dirs": [
"<!(node -e \"require('nan')\")",

Does anyboby have a clue on how to fix this ?

PD.- of course, the file is where the path indicates:

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

Answer Source

Because binding.gyp is in JSON, the String "c:\MQ\tools\cplus\include"is a standard JavaScript String, and therefore the \ needs to be escaped to \\.

So you should replace "c:\MQ\tools\cplus\include" into "c:\\MQ\\tools\\cplus\\include".

I hope that fixes the problem...

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download