Hey Ryan,

So ya, it looks like you're not linking against the HDF5 library, only
including its header files. You need to add a "libraries" section to the
binding.gyp file. See
https://github.com/pkrumins/node-png-sync/blob/7fcba5ae569f23a1aec277fdbcd47da8a728f4c1/binding.gyp#L17-20for
an example. I'm guessing you'll need to put something like "-lhdf5" or
whatever the library gets installed as.

Also, if you use the latest v0.7.x release of node then you'll get a more
helpful error message about why the module cannot be loaded.

On Sat, Apr 21, 2012 at 6:50 PM, Ryan <r...@rycole.com> wrote:

> Hello,
>
> I'm learning how to write C++ modules, for Node.js. I'm sort of
> brute-forcing my learning by looking at examples, referencing the
> documentation for v8 and trial and error. The only two modules that I can
> seem to think of, as a reference, are hiredis-node and node.bcrypt.js. Both
> have helped me get to where I am now, which is able to compile a base
> skeleton module, using node-gyp. Are there any other modules that are
> written in C++ that would be simple + good to reference?
>
> For example, I'm currently trying to write a module that simply wraps and
> exposes a class from an existing third-party lib, HDF5. I've got it all
> written to the point where I think I am supposed to initialize an object of
> that class I want to expose, but when I include the code to initialize it,
> I cannot `require` it from within Node. It will compile, but I cannot
> require it. I do not think it is actually compiling properly. The HDF5 lib
> comes with a special wrapper binary around g++ that sets up the compile
> environment for you, so I guess I need to figure out how to tell node-gyp
> to use that.
>
> My code is here, if anyone wants to take a peek:
> https://github.com/ryancole/node-hdf5
>
> Thanks
>
> --
> 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 nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to