Ok, so I installed 0.7.6 and compiled with node-gyp fine and this time a
little more details but I'm not sure how to resolve this issue.
> process.version
'v0.7.6'
> l = require('./freeling.node')
Error: /home/roy/freeling/node_bind/build/Debug/freeling.node: undefined
symbol: _ZN17FreeLingTokenizer10GetWStringEN2v86HandleINS0_6StringEEE
at Object..node (module.js:476:11)
at Module.load (module.js:352:32)
at Function._load (module.js:310:12)
at Module.require (module.js:358:17)
at require (module.js:374:17)
at repl:1:6
at REPLServer.eval (repl.js:85:21)
at Interface.<anonymous> (repl.js:202:12)
at Interface.emit (events.js:67:17)
at Interface._onLine (readline.js:169:10)
Inside my class declaration under private I have this:
static std::wstring GetWString(v8::Handle<v8::String> str);
Then in my .cc file I have the actual function:
// Convert a V8 string to a wide string.
std::wstring GetWString(v8::Handle<v8::String> str) {
v8::HandleScope scope;
uint16_t* buf = new uint16_t[str->Length()+1];
str->Write(buf);
std::wstring value = reinterpret_cast<wchar_t*>(buf);
delete [] buf;
return value;
}
I'm not sure why the error is "undefined symbol".
Thanks,
Roy
On Monday, March 26, 2012 5:30:29 PM UTC-4, SteveCronin wrote:
>
> I'm getting an error when I 'require' a module I have built.
>
> Is this a 32/64bit issue? If so how do I best correct for future node
> compatibility?
>
> node 0.6.13 on Mac OS X 10.7.3
>
> I'm still using node-waf to manually compile modules -- is that the
> problem?
> Here's the wscript:
> srcdir = '.'
> blddir = 'build'
> VERSION = '1.0.0'
> APPNAME = 'XYZ-ABC-utils'
>
> def set_options(opt):
> opt.tool_options('compiler_cxx')
>
> def configure(conf):
> conf.check_tool('compiler_cxx')
> conf.check_tool('node_addon')
>
> def build(bld):
> obj = bld.new_task_gen('cxx', 'shlib', 'node_addon')
> obj.source = 'node-ABC-support.cc', 'ABC1-support.cc',
> 'ABC2-support.cc', 'ABC3-support.cc'
> obj.libpath = [ bld.path.abspath() ]
> obj.lib = 'GHJ.o'
> bld.env.append_value('LINKFLAGS', '-lcrypto -lssl -lz'.split())
> obj.target = 'XYZ-ABC-utils'
>
> Even if I add this line to the script I still get the same errors:
>
> obj.cxxflags = ["-g", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE"]
>
On Monday, March 26, 2012 5:30:29 PM UTC-4, SteveCronin wrote:
>
> I'm getting an error when I 'require' a module I have built.
>
> Is this a 32/64bit issue? If so how do I best correct for future node
> compatibility?
>
> node 0.6.13 on Mac OS X 10.7.3
>
> I'm still using node-waf to manually compile modules -- is that the
> problem?
> Here's the wscript:
> srcdir = '.'
> blddir = 'build'
> VERSION = '1.0.0'
> APPNAME = 'XYZ-ABC-utils'
>
> def set_options(opt):
> opt.tool_options('compiler_cxx')
>
> def configure(conf):
> conf.check_tool('compiler_cxx')
> conf.check_tool('node_addon')
>
> def build(bld):
> obj = bld.new_task_gen('cxx', 'shlib', 'node_addon')
> obj.source = 'node-ABC-support.cc', 'ABC1-support.cc',
> 'ABC2-support.cc', 'ABC3-support.cc'
> obj.libpath = [ bld.path.abspath() ]
> obj.lib = 'GHJ.o'
> bld.env.append_value('LINKFLAGS', '-lcrypto -lssl -lz'.split())
> obj.target = 'XYZ-ABC-utils'
>
> Even if I add this line to the script I still get the same errors:
>
> obj.cxxflags = ["-g", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE"]
>
--
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