IBM / nodejs-idb-connector

A JavaScript (Node.js) library for communicating with Db2 for IBM i, with support for queries, procedures, and much more. Uses traditional callback-style syntax
MIT License
37 stars 23 forks source link

npm install --build-from-source sqlcli.h: No such file or directory #65

Closed jasonclake closed 5 years ago

jasonclake commented 5 years ago
npm install --build-from-source
...
In file included from ../src/db2ia/db2ia.cc:10:0:
../src/db2ia/dbconn.h:13:20: fatal error: sqlcli.h: No such file or directory
...

This explains where to find it: https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_73/cli/rzadphdhed.htm

I copied the required files to the db2ia folder so I could hack away--however

Is there a recommended way to make sqlcli.h (and sql.h, sqlsystm.h...) available during the build -- or did I miss a step after cloning the project?

ThePrez commented 5 years ago

You can install the sqlcli-devel package with yum, which will ship the CLI headers in /QOpenSys/pkgs/include/cli

You probably then need to alter compile flags to include that directory. We should add this directory to binding.gyp so no manual steps are needed. @dmabupt, can you put that on your "TODO" list?

dmabupt commented 5 years ago

Hello @jasonclake The easiest way is calling yum install sqlcli-devel to install the missing headers. But I need to upgrade idb-connector to support this new package. For now, you can manually extract them from your system with below CL commands --

CPYTOSTMF FROMMBR('/qsys.lib/qsysinc.lib/h.file/sql.mbr') TOSTMF('/QOpenSys/pkgs/include/sql.h')
CPYTOSTMF FROMMBR('/qsys.lib/qsysinc.lib/h.file/sqlca.mbr') TOSTMF('/QOpenSys/pkgs/include/sqlca.h')
CPYTOSTMF FROMMBR('/qsys.lib/qsysinc.lib/h.file/sqlcli.mbr') TOSTMF('/QOpenSys/pkgs/include/sqlcli.h')
CPYTOSTMF FROMMBR('/qsys.lib/qsysinc.lib/h.file/sqlsystm.mbr') TOSTMF('/QOpenSys/pkgs/include/sqlsystm.h')
CPYTOSTMF FROMMBR('/qsys.lib/qsysinc.lib/h.file/sqludf.mbr') TOSTMF('/QOpenSys/pkgs/include/sqludf.h')