I finaaly managed to get the below error, when created the *.node using
gyp in the Ubuntu platform and copied in to the Target.
root@bosch-nemid:~/Release-2/build/Release/lib.target# node ARM.js
module.js:480
process.dlopen(filename, module.exports);
^
Error: /home/root/Release-2/build/Release/lib.target/hu.node: undefined
symbol: init
at Object.Module._extensions..node (module.js:480:11)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object.<anonymous>
(/home/root/Release-2/build/Release/lib.target/ARM.js:1:78)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
Please find below my binding.gyp code,
{
'targets' : [
{
'target_name': 'hu',
'type': 'shared_library',
'sourcess': [ 'NJSAQ.cc' ],
'include_dirs': ['/home/pavincoll/Desktop/ARMRFS3/usr/include',
'/home/pavincoll/Desktop/ARMRFS3/usr/include/alsa',
'/home/pavincoll/Desktop/ARMRFS3/usr/include/curl',
'/opt/tooling/mvista/MV_20110822/symphony-ivi-2.6.34/tools/tools/arm-gnueabi/arm-montavista-linux-gnueabi/target-toolchain/arm-montavista-linux-gnueabi/libc/usr/bin'
, '/home/pavincoll/Desktop/ARMRFS3/usr/lib',
'/home/pavincoll/workspace/aqstub/src'],
'link_settings': {
'libraries': ['/usr/local/lib/libaqARM.so',
'/usr/local/lib/libsqARM_1.so', '/usr/local/lib/libspARM.so']
}
}
]
}
On Wednesday, August 29, 2012 12:03:48 PM UTC-7, Pavi wrote:
>
> Some times for the same i get the below error, when created the *.node
> using gyp in the Ubuntu platform and copied in to the Target.
>
> root@bosch-nemid:~/Release-2/build/Release/lib.target# node ARM.js
>
> module.js:480
> process.dlopen(filename, module.exports);
> ^
> Error: /home/root/Release-2/build/Release/lib.target/hu.node: undefined
> symbol: init
> at Object.Module._extensions..node (module.js:480:11)
> at Module.load (module.js:356:32)
> at Function.Module._load (module.js:312:12)
> at Module.require (module.js:362:17)
> at require (module.js:378:17)
> at Object.<anonymous>
> (/home/root/Release-2/build/Release/lib.target/ARM.js:1:78)
> at Module._compile (module.js:449:26)
> at Object.Module._extensions..js (module.js:467:10)
> at Module.load (module.js:356:32)
> at Function.Module._load (module.js:312:12)
>
>
> Please find below my binding.gyp code,
> {
> 'targets' : [
> {
> 'target_name': 'hu',
> 'type': 'shared_library',
> 'sourcess': [ 'NJSAQ.cc' ],
> 'include_dirs': ['/home/pavincoll/Desktop/ARMRFS3/usr/include',
> '/home/pavincoll/Desktop/ARMRFS3/usr/include/alsa',
> '/home/pavincoll/Desktop/ARMRFS3/usr/include/curl',
> '/opt/tooling/mvista/MV_20110822/symphony-ivi-2.6.34/tools/tools/arm-gnueabi/arm-montavista-linux-gnueabi/target-toolchain/arm-montavista-linux-gnueabi/libc/usr/bin'
>
> , '/home/pavincoll/Desktop/ARMRFS3/usr/lib',
> '/home/pavincoll/workspace/aqstub/src'],
> 'link_settings': {
> 'libraries': ['/usr/local/lib/libaqARM.so',
> '/usr/local/lib/libsqARM_1.so', '/usr/local/lib/libspARM.so']
> }
> }
> ]
> }
>
>
Please find below the *.cc code,
#include <v8.h>
#include <node.h>
#include "aq_api.h"
using namespace node;
using namespace v8;
/**
* Checks that the passed V8 Object is of type Function and casts it
* to a Function with the specified name.
*
* @param I Object to be cast to a Function.
* @param VAR Name of the local Function variable to be created and set
* to I.
*/
#define REQ_FUN_ARG(I, VAR) \
if (args.Length() <= (I) || !args[I]->IsFunction()) \
return ThrowException(Exception::TypeError( \
String::New("Argument " #I " must be a function"))); \
Local<Function> VAR = Local<Function>::Cast(args[I]);
/**
* Node.js V8 addon wrapper class for the Audio Manager.
*/
class NJSAQ : ObjectWrap
{
private:
static const int SET_PHONE_CALL_PERMISSION =2;
aq _aq;
public:
static Persistent<FunctionTemplate> s_ct;
/**
* V8 module initializer.
*/
static void Init(Handle<Object> target)
{
HandleScope scope;
Local<FunctionTemplate> t = FunctionTemplate::New(New);
s_ct = Persistent<FunctionTemplate>::New(t);
s_ct->InstanceTemplate()->SetInternalFieldCount(1);
s_ct->SetClassName(String::NewSymbol("NJSAQ"));
NODE_SET_PROTOTYPE_METHOD(s_ct, "aqSetPhoneCallPermission",
aqSetPhoneCallPermissionAsync);
target->Set(String::NewSymbol("NJSAQ"),
s_ct->GetFunction());
}
/**
* Default constructor.
*/
NJSAQ()
{
}
/**
* Default destructor.
*/
~NJSAQ()
{
}
/**
* V8 module constructor.
*/
static Handle<Value> New(const Arguments& args)
{
HandleScope scope;
NJSAQ* am = new NJSAQ();
am->Wrap(args.This());
return args.This();
}
/**
* Data passed between dictationAsync() asynchronous functions.
*/
struct AQ_SET_PHONECALL_PERMISSIONBaton_t
{
NJSAQ *am;
Persistent<Function> callback;
bool bCallpermission;
};
static Handle<Value> aqSetPhoneCallPermissionAsync(const Arguments& args)
{
HandleScope scope;
REQ_FUN_ARG(SET_PHONE_CALL_PERMISSION - 1, callback);
NJSAQ* am = ObjectWrap::Unwrap<NJSAQ>(args.This());
AQ_SET_PHONECALL_PERMISSIONBaton_t * baton = new
AQ_SET_PHONECALL_PERMISSIONBaton_t();
baton->callback = Persistent<Function>::New(callback);
baton->am = am;
baton->bCallpermission = args[0]->BooleanValue();
am->Ref();
eio_custom(eioaqSetPhoneCallPermissionAsync, EIO_PRI_DEFAULT,
eioaqSetPhoneCallPermissionAsyncPost, baton);
ev_ref(EV_DEFAULT_UC);
return Undefined();
}
/**
*
*/
static void eioaqSetPhoneCallPermissionAsync(eio_req *req)
{
AQ_SET_PHONECALL_PERMISSIONBaton_t *baton =
static_cast<AQ_SET_PHONECALL_PERMISSIONBaton_t*>(req->data);
baton->am->_aq.aqSetPhoneCallPermission(baton->bCallpermission);
}
/**
*
*/
static int eioaqSetPhoneCallPermissionAsyncPost(eio_req *req)
{
HandleScope scope;
AQ_SET_PHONECALL_PERMISSIONBaton_t *baton =
static_cast<AQ_SET_PHONECALL_PERMISSIONBaton_t *>(req->data);
ev_unref(EV_DEFAULT_UC);
baton->am->Unref();
Local<Value> argv[0];
TryCatch try_catch;
baton->callback->Call(Context::GetCurrent()->Global(), 0, argv);
if (try_catch.HasCaught()) {
FatalException(try_catch);
}
baton->callback.Dispose();
delete baton;
return 0;
}
};
Persistent<FunctionTemplate> NJSAQ::s_ct;
extern "C" {
static void init (Handle<Object> target)
{
NJSAQ::Init(target);
}
NODE_MODULE(aqARM, init);
}
>
>
> On Tuesday, August 28, 2012 3:40:24 PM UTC-7, mscdex wrote:
>>
>> On Aug 28, 6:34 pm, Pavi <[email protected]> wrote:
>> > Please find below the code of wscript:
>>
>> First thing you should do is switch to gyp.
>>
>
--
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