-
-
Notifications
You must be signed in to change notification settings - Fork 815
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
Please Help: Trying to Build RELEASE for Windows with VS Express C++ 2010 #55
Comments
I'm not aware of how to get a working Release build out of the existing Visual Studio file, so I just went with a gyp approach and upload my build to https://github.com/developmentseed/node-sqlite3/downloads. |
the 'vcbuild.bat' is a hack that uses the gyp file I just added (undocumented). I can document how to utilize it on Monday. Ping me then, as I'm out for the weekend now. |
Thanks! (And that for the phenomenally quick reply!) Have an excellent weekend! -- Carlos |
Adding some notes for discussion on Monday. Clean start. Grabbed the node 0.6.7 sources and built node in Release (' vcbuild.bat release' ). Works. Downloaded a fresh copy of the windows branch of node-sqlite3. Still using VS GUI for node-sqlite3 build. Copied the node-sqlite3.node to %HOME_DIR%\test\node_modules. var s = require('node_sqlite3'); // ok The error is...
and node terminates abnormally. Back at the command line, I'm not sure where to start looking. I remember the warnings I saw when building node-sqlite3 about (not having) __declspec(dllexport) on templates within classes which do have __declspec(dllexport) decoration. I'm 90% sure that's cosmetic, as usual. Next I do a full-tree diff between the master and windows branches of node-sqlite3. All the windows #ifdefs look good. Verified that VS really is building with _WIN32 to get the right threading model. Looked at the new gyp stuff. Tried. I seem to be missing something. Will definitely need to ask springmeyer. Encouraged, but not quite feeling the node-on-Windows love yet. :) |
you need to make sure the |
Aha. I suspected (from grepping) for 'verbose' and learning that's
|
Success!!! Sure enough. I missed (1) that having the js files in /lib is critical and (2) the name to 'require' depends a little on how which step in node's search logic finds it. Awesome. Thanks! |
I am very close to having a build, but I need a little help!
I hope this also helps someone else. I am using Windows XP Pro (yeah, yeah) with Visual Studio Express 2010 C++.
First, it would be good to tell three things:
So now I follow all the instructions at https://github.com/developmentseed/node-sqlite3/wiki/Building-On-Windows ** up to **
"Go to the "Property Manager" ... "
at which point I realize that VS Express 2008/2010 (and VS also I think) have slightly different interfacess from what I am used to. But I am an experienced visual studio user, so I press on.
I am in VS. The solution opens up in Release mode for me. This will be significant below.
** I need to know exactly what I'm supposed to be adding to the compiler and linker paths, but the instructions "change all three paths in "Additional Include Directories" to match those on your system" are pretty vague. Ok, fine, I think, I will just try to build and let VS tell me what it cannot find. But when I do this, I get exactly one error which will be familiar to VS developers:
deps\sqlite3\sqlite3.c(131070): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?
Thinking the sln file was maybe not created by a WIndows developer, I tell the compiler not to use precompiled headers and I try to build again. Now I get the kind of error I was looking for:
src\database.cc(2): fatal error C1083: Cannot open include file: 'node.h': No such file or directory.
So I add (in my case) C:\NODEV\node-v0.6.6\src to the compiler include path. Try to build again. Get this:
fatal error C1083: Cannot open include file: 'uv.h': No such file or directory
So I add C:\NODEV\node-v0.6.6\deps\uv\include to the compiler include path. Try to build again. Get this:
fatal error C1083: Cannot open include file: 'v8.h': No such file or directory
So I add C:\NODEV\node-v0.6.6\deps\v8\include to the compiler include path. Try to build again. Get this:
fatal error C1083: Cannot open include file: 'sqlite3.h': No such file or directory
So I add C:\Documents and Settings\root\Desktop\developmentseed-node-sqlite3-v2.1.1-15-ge6b1f79\developmentseed-node-sqlite3-e6b1f79\deps\sqlite3
to the compiler path. (This is where I unpacked node-sqlite sources for windows.)
Try to build again. Finally no more compiler errors and now get link errors. Good!
Read through the link errors. Guess. Add C:\NODEV\node-v0.6.6\Debug\lib to the linker path and add the following libs to the linker dependencies:
v8_base.lib
v8_nosnapshot.lib
v8_snapshot.lib
uv.lib
openssl.lib
http_parser.lib
zlib.lib
Try to build again.
I get numerous errors like this:
v8_base.lib(api.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in database.obj
This suggests ( ** please tell me **) that this has something to do with the fact that the vcbuild.bat file (for node) build node in Debug but the node-sqlite project is built in Release.
SO I switch the VS build configuration mode to Debug and try to build again. Ah! Most of the errors are gone, and now I have to set all the optrions for Debug mode. (ya gotta love VS!)
The first thing I notice (in Debug settings now) is that someone upstream has tried to fix the deps already with this:
$(ProjectDir)deps\sqlite3 except that they misspelled "Project".
That line does not work in any version of VS I have ever used anyway, because VS is not smart enough to descend paths. So I just go ahead and add the same paths as above.
So here I go adding the include and lib paths to the Debug config pretty much the same way I did above...
I see that "kkaefer" appears in teh lib path for the Debug configuration, so I think I am on the right path (bad pun!) now and change that to match the lib path from my Node build instead, which is C:\NODEV\node-v0.6.6\Debug\lib
Try to build... SUCCESS!!! YEAH!!! But what does this mean...
I now have node_sqlite3.node and sqlite3.lib and I have no idea what to do with them. ** Please Help The Newbie! **
Also, it is now apparent that in order to get node-sqlite built in release, I will first need to build node in Release. I guess I will be looking at the vcbuild.bat file (for node) next.
I apologize for the long post. I see there is much interest in node-sqlite for Winnows. Hopefully it helps someone else.
I would appreciate some advice on how to install the module now that I have built it!
Thanks
The text was updated successfully, but these errors were encountered: