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

Does Not Build on OS X #4

Open
bigeasy opened this issue Aug 12, 2010 · 7 comments
Open

Does Not Build on OS X #4

bigeasy opened this issue Aug 12, 2010 · 7 comments

Comments

@bigeasy
Copy link

bigeasy commented Aug 12, 2010

It does not build on OS X. I installed the latest Node.js using Homebrew.
Checked node-sqlite out of GitHub and ran the following.

[alan@postojna node-sqlite]$ node-waf configure build
Checking for program g++ or c++          : /usr/bin/g++
Checking for program cpp                 : /usr/bin/cpp
Checking for program ar                  : /usr/bin/ar
Checking for program ranlib              : /usr/bin/ranlib
Checking for g++                         : ok
Checking for node path                   : not found
Checking for node prefix                 : ok /opt/Cellar/node/0.1.103
Checking for sqlite3                     : not found
Checking for library sqlite3             : yes
'configure' finished successfully (0.419s)
Waf: Entering directory `/Users/alan/git/synapse/node-sqlite/build'
[1/4] cxx: src/sqlite3_bindings.cc -> build/default/src/sqlite3_bindings_1.o
[2/4] cxx: src/database.cc -> build/default/src/database_1.o
../src/database.h:95: error: ‘sqlite3_int64’ does not name a type
../src/database.h:95: error: ‘sqlite3_int64’ does not name a type
../src/database.cc: In static member function ‘static int Database::EIO_Open(eio_req*)’:
../src/database.cc:99: error: ‘SQLITE_OPEN_READWRITE’ was not declared in this scope
../src/database.cc:100: error: ‘SQLITE_OPEN_CREATE’ was not declared in this scope
../src/database.cc:101: error: ‘SQLITE_OPEN_FULLMUTEX’ was not declared in this scope
../src/database.cc:102: error: ‘sqlite3_open_v2’ was not declared in this scope
../src/database.cc: In static member function ‘static int Database::EIO_AfterPrepareAndStep(eio_req*)’:
../src/database.cc:274: error: ‘struct prepare_request’ has no member named ‘lastInsertId’
../src/database.cc: In static member function ‘static int Database::EIO_PrepareAndStep(eio_req*)’:
../src/database.cc:348: error: ‘struct prepare_request’ has no member named ‘lastInsertId’
../src/database.cc:353: error: ‘struct prepare_request’ has no member named ‘lastInsertId’
../src/database.cc: In static member function ‘static int Database::EIO_Prepare(eio_req*)’:
../src/database.cc:447: error: ‘struct prepare_request’ has no member named ‘lastInsertId’
../src/database.cc:452: error: ‘struct prepare_request’ has no member named ‘lastInsertId’
Waf: Leaving directory `/Users/alan/git/synapse/node-sqlite/build'
Build failed:
 -> task failed (err #1):
    {task: cxx sqlite3_bindings.cc -> sqlite3_bindings_1.o}
 -> task failed (err #1):
    {task: cxx database.cc -> database_1.o}
@lexander
Copy link

I'm seeing the same issue on OS X version 10.5.8

@lexander
Copy link

Found a fix, in database.h
change the line that reads
#include <sqlite3.h>
to
#include "sqlite3.h"

This will change the include from using the standard include path to using the file "sqlite3.h" in the current working directory.

Then download the sqlite3 source files from http://www.sqlite.org/download.html and copy the sqlite3.h file into your /node-sqlite/src/ directory and re-run the configure/build command.

@lexander
Copy link

There should be a 'pound' symbol at the start of those include lines - GitHub Markdown turned my pounds into hr's

@lexander
Copy link

Even better, download the source files for sqlite, build and install from source. This will place sqlite in your /bin directory and make the headers available for the node-sqlite build.

@arikon
Copy link

arikon commented Oct 11, 2010

Can't install this extension on Ubuntu Hardy, with same errors.

@orlandov
Copy link
Owner

Yeah, trying to figure out where SQLite lives on different platforms is an annoying pain in the ass. Soon I will just ship the amalgamated SQLite source with node-sqlite and build it as a dependency.

@duarnad
Copy link

duarnad commented Nov 28, 2010

On ubuntu, may be you can try to install the package libsqlite3-dev to ensure you have sqlite3.h available.

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

5 participants