Nathan, 

I'm having a similar problem.  I tried node-waf and node-gyp but both 
result in the same error (unable to load share library).  I'm running 
Fedora 14 (in VM) with node 0.6.7 and 0.6.13.

I checked that my NODE_MODULE declaration is correct and it is.

Here is my module declaration:

#define FREE_LING_BINDING
#include <node.h>
#include <v8.h>
#include "freeling_tokenizer.h"

void InitAll(v8::Handle<v8::Object> target) {
FreeLingTokenizer::Init(target);
}

NODE_MODULE(freeling, InitAll)

Here is my Init:

#define FREE_LING_TOKENIZER

#include <node.h>
#include <v8.h>

#include "freeling_tokenizer.h"

FreeLingTokenizer::FreeLingTokenizer() {};
FreeLingTokenizer::~FreeLingTokenizer() {};

void FreeLingTokenizer::Init(v8::Handle<v8::Object> target) {
v8::HandleScope scope;
//using the functionTemplate, create a function FreeLingTokenizer
v8::Local<v8::FunctionTemplate> tpl = v8::FunctionTemplate::New(New);
tpl->SetClassName(v8::String::NewSymbol("FreeLingTokenizer"));
tpl->InstanceTemplate()->SetInternalFieldCount(1);

//create prototype chain for above function
tpl->PrototypeTemplate()->Set(v8::String::NewSymbol("tokenize"),
v8::FunctionTemplate::New(Tokenize)->GetFunction());
v8::Persistent<v8::Function> constructor = 
v8::Persistent<v8::Function>::New(tpl->GetFunction());
 target->Set(v8::String::NewSymbol("FreeLingTokenizer"), constructor);
}

Here is my binding.gyp:

{
  'targets': [
    {
      'target_name': 'freeling',
      'conditions': [
      ['OS=="linux"', {
      'cflags': ['-I/home/roy/freeling/free3/include']
      }]
      ],
      'sources': [ 'freeling.cc', 'freeling_tokenizer.cc' ]
    }
  ]
}


Thanks,
Roy

On Tuesday, March 27, 2012 1:20:35 PM UTC-4, Nathan Rajlich wrote:
>
> You should have something like this in your .cc file: 
> https://github.com/joyent/node/blob/master/test/addons/hello-world/binding.cc#L15
>
> On Tue, Mar 27, 2012 at 9:05 AM, SteveCronin <[email protected]>wrote:
>
>> Nathan;
>>
>> I don't understand the 'NODE_MODULE' comment.
>> I don't have any such macro...
>> My module wraps a class written in C++...
>> Can you point me to something which would provide more details on what 
>> you meant?
>>
>> Steve
>>
>>
>> On Monday, March 26, 2012 8:01:00 PM UTC-5, Nathan Rajlich wrote:
>>>
>>> I'm still using node-waf to manually compile modules -- is that the 
>>>> problem?
>>>>
>>>
>>> Give node-gyp a shot: 
>>> https://github.com/**TooTallNate/node-gyp<https://github.com/TooTallNate/node-gyp>
>>>
>>> Also note that the "target_name" property (the "obj.target" in the 
>>> wscript) must match the first argument to the NODE_MODULE macro in your 
>>> module's entry point.
>>>  
>>  -- 
>> 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
>>
>
>

-- 
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

Reply via email to