Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error building sqlite3 with sqlcipher for node-webkit on Windows 7: Cannot open include file: 'sqlite3.h' #697

Closed
ua2004 opened this issue Aug 28, 2016 · 2 comments

Comments

@ua2004
Copy link

ua2004 commented Aug 28, 2016

I would really appreciate some help.

I have the following installed:

  • Windows 7 x64
  • node 5.8.0
  • npm 3.7.3
  • node-webkit 0.12.3 x64
  • Python 2.7
  • MS Visual Studio 2012 Ultimate

I have downloaded sqlcipher from github and unpacked it into C:\sqlcipher folder, as described here. I tried to build sqlite3 with sqlcipher from source using this manual. Since I'm on Windows I can't use

export LDFLAGS="-L/usr/local/lib"
export CPPFLAGS="-I/usr/local/include -I/usr/local/include/sqlcipher"
export CXXFLAGS="-I/usr/local/include -I/usr/local/include/sqlcipher"

That's why I used

export LDFLAGS="-L/c/sqlcipher"
export CPPFLAGS="-I/c/sqlcipher"
export CXXFLAGS="-I/c/sqlcipher"
npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=x64 --target=0.12.3 --sqlite_libname=sqlcipher --sqlite=/c/sqlcipher

It starts compiling, Visual Studio is building the project. But then it shows me the error: fatal error C1083: Cannot open include file: 'sqlite3.h': No such file or directory [D:\Node\nwjs-v0.12.3-win-x64\node_modules\sqlite3\build\node_sqlite3.vcxproj]

However, the file sqlite3.h is located in C:\sqlcipher folder. My project folder is located in D:\Node\nwjs-v0.12.3-win-x64\, and I run the build process from there. Previously, I tried to build sqlite3 without sqlcipher

npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=x64 --target=0.12.3

and it worked perfectly.

Here is my log:

$ npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=x64 --target=0.12.3 --sqlite_libname=sqlcipher --sqlite=/c/sqlcipher

> [email protected] install D:\Node\nwjs-v0.12.3-win-x64\node_modules\sqlite3
> node-pre-gyp install --fallback-to-build


D:\Node\nwjs-v0.12.3-win-x64\node_modules\sqlite3>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" clean )  else (node "" clean )
(node) child_process: options.customFds option is deprecated. Use options.stdio instead.
(node) child_process: options.customFds option is deprecated. Use options.stdio instead.
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  database.cc
  node_sqlite3.cc
  statement.cc
..\src\node_sqlite3.cc(5): fatal error C1083: Cannot open include file: 'sqlite3.h': No such file or directory [D:\Node\nwjs-v0.12.3-win-x64\node_modules\sqlite3\build\node_sqlite3.vcxproj]
d:\node\nwjs-v0.12.3-win-x64\node_modules\sqlite3\src\database.h(9): fatal error C1083: Cannot open include file: 'sqlite3.h': No such file or directory (..\src\database.cc) [D:\Node\nwjs-v0.12.3-win-x64\node_modules\sqlite3\build\node_sqlite3.vcxproj]
d:\node\nwjs-v0.12.3-win-x64\node_modules\sqlite3\src\database.h(9): fatal error C1083: Cannot open include file: 'sqlite3.h': No such file or directory (..\src\statement.cc) [D:\Node\nwjs-v0.12.3-win-x64\node_modules\sqlite3\build\node_sqlite3.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\Andrew\AppData\Roaming\npm\node_modules\nw-gyp\lib\build.js:286:23)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Andrew\\AppData\\Roaming\\npm\\node_modules\\nw-gyp\\bin\\nw-gyp.js" "build" "--fallback-to-build" "--module=D:\\Node\\nwjs-v0.12.3-win-x64\\node_modules\\sqlite3\\lib\\binding\\node-webkit-v0.12.3-win32-x64\\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=D:\\Node\\nwjs-v0.12.3-win-x64\\node_modules\\sqlite3\\lib\\binding\\node-webkit-v0.12.3-win32-x64"
gyp ERR! cwd D:\Node\nwjs-v0.12.3-win-x64\node_modules\sqlite3
gyp ERR! node -v v5.8.0
gyp ERR! nw-gyp -v v0.13.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'nw-gyp.cmd build --fallback-to-build --module=D:\Node\nwjs-v0.12.3-win-x64\node_modules\sqlite3\lib\binding\node-webkit-v0.12.3-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=D:\Node\nwjs-v0.12.3-win-x64\node_modules\sqlite3\lib\binding\node-webkit-v0.12.3-win32-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (D:\Node\nwjs-v0.12.3-win-x64\node_modules\sqlite3\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:100:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:850:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
node-pre-gyp ERR! System Windows_NT 6.1.7601
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\Node\\nwjs-v0.12.3-win-x64\\node_modules\\sqlite3\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd D:\Node\nwjs-v0.12.3-win-x64\node_modules\sqlite3
node-pre-gyp ERR! node -v v5.8.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.24
node-pre-gyp ERR! not ok
Failed to execute 'nw-gyp.cmd build --fallback-to-build --module=D:\Node\nwjs-v0.12.3-win-x64\node_modules\sqlite3\lib\binding\node-webkit-v0.12.3-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=D:\Node\nwjs-v0.12.3-win-x64\node_modules\sqlite3\lib\binding\node-webkit-v0.12.3-win32-x64' (1)
nw-test@ D:\Node\nwjs-v0.12.3-win-x64
+-- [email protected]  extraneous
`-- [email protected]  extraneous

npm WARN nw-test@ No description
npm WARN nw-test@ No repository field.
npm WARN nw-test@ No license field.
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "sqlite3" "--build-from-source" "--runtime=node-webkit" "--target_arch=x64" "--target=0.12.3" "--sqlite_libname=sqlcipher" "--sqlite=C:/sqlcipher"
npm ERR! node v5.8.0
npm ERR! npm  v3.7.3
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the sqlite3 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs sqlite3
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls sqlite3
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     D:\Node\nwjs-v0.12.3-win-x64\npm-debug.log
@tmcw
Copy link
Contributor

tmcw commented Sep 6, 2016

Duplicate of #497

@tmcw tmcw closed this as completed Sep 6, 2016
@fritx
Copy link

fritx commented Oct 8, 2016

related: #587

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants