w1nk / node-odbc

unixODBC bindings for node
MIT License
90 stars 101 forks source link

Library not loaded: /usr/local/lib/libodbc.2.dylib #81

Closed bradenpowers closed 9 years ago

bradenpowers commented 9 years ago

Hello,

I am trying to get this running and I am running into a snag. I did install the unixODBC using homebrew and they were installed successfully. I am following the getting started example and I got this error:

Error: dlopen(/myproject/node_modules/odbc/build/Release/odbc_bindings.node, 1): Library not loaded: /usr/local/lib/libodbc.2.dylib Referenced from: /myproject/node_modules/odbc/build/Release/odbc_bindings.node

Any insights would be great!

Thanks, BP

wankdanker commented 9 years ago

What version of node are you using? Did it build successfully when you did npm install odbc?

bradenpowers commented 9 years ago

I am running node v0.10.26 and it built successfully, there were some warnings though.

wankdanker commented 9 years ago

I'm not a Mac user, so my help may be limited. Does /usr/local/lib/libodbc.2.dylib exist? Is that a reference to the unixODBC library from homebrew or is it in Apple's iODBC (or whatever it's called)? Does using the command line isql tool work?

bradenpowers commented 9 years ago

The isql tool does work. So what I tried to do now is build it from scratch and I get this when running node-gyp configure build

In file included from ../src/odbc.cpp:25: ../src/odbc.h:29:10: fatal error: 'sql.h' file not found

include

wankdanker commented 9 years ago

That usually indicates that the development/header files have not been installed or are not in the path for building to work. I'm not sure if homebrew installs those by default or if it is a separate process. I know on Ubuntu you have to do apt-get install unixodbc-dev. Not sure if there is something similar on your platform.

bradenpowers commented 9 years ago

I'll figure out something else.

Ceponce commented 9 years ago

Thanks Wankdanker, I had the same error and running "brew install unixodbc" fixed my issue