The short answer is that the linker you end up using on OS X doesn't behave quite the same as the one you end up using on your Linux system. I'd guess it's just the local deps/ folder not being included in the LIBRARY_PATH or something like that by default.
When you're working with an addon like this, especially where the code you depend on is already bundled, as it is here, you should pretty much always be linking statically. It will be much, much saner. Dynamic linking, the alternative, is usually better for libraries that the user is expected to have installed on their system separately. For a longer answer, I suggest some googling; the question of static vs. dynamic linking is pretty involved, when looked at from a broader perspective than just node addons. On Sun, Jul 22, 2012 at 9:45 AM, Geoff Flarity <[email protected]>wrote: > That fixed it! Thanks! Any idea why this worked on OS X? > > GF > > On Sunday, July 22, 2012 12:40:43 PM UTC-4, AvianFlu wrote: >> >> This sounds like a linker error - try changing the "type" field >> here<https://github.com/gflarity/node-leveldb/blob/master/deps/leveldb/leveldb.gyp#L39> >> to >> "static_library" and see if it helps. >> >> On Sun, Jul 22, 2012 at 9:30 AM, Geoff Flarity >> <[email protected]>wrote: >> >>> Hi, >>> >>> I'm trying to get node-leveldb to compile with node-gyp and node v0.8.3. >>> Forunately there's already a leveldb gyp file available from the Chromium >>> project. Someone else added these and everything seems to compile fine on >>> both OS X and Linux. However on Linux there's a lot of missing leveldb >>> symbols that should be defined. This obviously causes it break right away. >>> >>> Here's my fork, the branch that is working is called 'mocha_fixes'. >>> >>> https://github.com/gflarity/**node-leveldb<https://github.com/gflarity/node-leveldb> >>> >>> On OS X 'make test' passes. On Linux I get: >>> >>> > Node: symbol lookup error: /home/welladmin/src/node-** >>> leveldb/build/Release/leveldb.**node: undefined symbol: >>> _ZN7leveldb7OptionsC1Ev >>> >>> Digging a bit deeper, with 'nm' on OS X: >>> >>> $ nm leveldb.node | grep _ZN7leveldb7OptionsC1Ev >>> 0000000000020cac T __ZN7leveldb7OptionsC1Ev >>> >>> On Linux: >>> >>> nm leveldb.node | grep _ZN7leveldb7OptionsC1Ev >>> U _ZN7leveldb7OptionsC1Ev >>> >>> >>> Not sure why it work on one platform but not another after it compiles >>> OK. Thoughts? >>> >>> Cheers, >>> Geoff >>> >>> >>> -- >>> Job Board: http://jobs.nodejs.org/ >>> Posting guidelines: https://github.com/joyent/**node/wiki/Mailing-List-* >>> *Posting-Guidelines<https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines> >>> You received this message because you are subscribed to the Google >>> Groups "nodejs" group. >>> To post to this group, send email to [email protected] >>> To unsubscribe from this group, send email to >>> nodejs+unsubscribe@**googlegroups.com<nodejs%[email protected]> >>> For more options, visit this group at >>> http://groups.google.com/**group/nodejs?hl=en?hl=en<http://groups.google.com/group/nodejs?hl=en?hl=en> >>> >> >> >> >> -- >> Charlie McConnell >> Head of DevOps >> Nodejitsu, Inc. >> [email protected] >> >> -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > -- Charlie McConnell Head of DevOps Nodejitsu, Inc. [email protected] -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
