I've updated my nodejs installation to v12.2.0, and now I get a huge error while compiling an extension that worked fine previously.
libneon_runtime-388232a462956889.rlib(neon.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) protected: static class v8::internal::Object * * __cdecl v8::HandleScope::CreateHandle(class v8::internal::Isolate *,class v8::internal::Object *)" (__imp_?CreateHandle@HandleScope@v8@@KAPEAPEAVObject@internal@2@PEAVIsolate@42@PEAV342@@Z) referenced in function "void __cdecl neon::complete_task(struct uv_work_s *)" (?complete_task@neon@@YAXPEAUuv_work_s@@@Z)
libneon_runtime-388232a462956889.rlib(neon.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) private: class v8::internal::Object * * __cdecl v8::EscapableHandleScope::Escape(class v8::internal::Object * *)" (__imp_?Escape@EscapableHandleScope@v8@@AEAAPEAPEAVObject@internal@2@PEAPEAV342@@Z) referenced in function Neon_Convert_ToObject
libneon_runtime-388232a462956889.rlib(neon.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __cdecl v8::String::Utf8Length(void)const " (__imp_?Utf8Length@String@v8@@QEBAHXZ) referenced in function Neon_String_Utf8Length
libneon_runtime-388232a462956889.rlib(neon.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class v8::Local<class v8::Function> __cdecl v8::FunctionTemplate::GetFunction(void)" (__imp_?GetFunction@FunctionTemplate@v8@@QEAA?AV?$Local@VFunction@v8@@@2@XZ) referenced in function Neon_Class_Constructor
libneon_runtime-388232a462956889.rlib(neon.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) private: static class v8::internal::Object * * __cdecl v8::V8::GlobalizeReference(class v8::internal::Isolate *,class v8::internal::Object * *)" (__imp_?GlobalizeReference@V8@v8@@CAPEAPEAVObject@internal@2@PEAVIsolate@42@PEAPEAV342@@Z) referenced in function "public: virtual void __cdecl neon::BaseClassMetadata::construct(class v8::FunctionCallbackInfo<class v8::Value> const &)" (?construct@BaseClassMetadata@neon@@UEAAXAEBV?$FunctionCallbackInfo@VValue@v8@@@v8@@@Z)
libneon_runtime-388232a462956889.rlib(neon.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) private: static void __cdecl v8::V8::DisposeGlobal(class v8::internal::Object * *)" (__imp_?DisposeGlobal@V8@v8@@CAXPEAPEAVObject@internal@2@@Z) referenced in function "protected: virtual __cdecl neon::ClassMetadata::~ClassMetadata(void)" (??1ClassMetadata@neon@@MEAA@XZ)
libneon_runtime-388232a462956889.rlib(neon.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) private: static void __cdecl v8::V8::MakeWeak(class v8::internal::Object * *,void *,void (__cdecl*)(class v8::WeakCallbackInfo<void> const &),enum v8::WeakCallbackType)" (__imp_?MakeWeak@V8@v8@@CAXPEAPEAVObject@internal@2@PEAXP6AXAEBV?$WeakCallbackInfo@X@2@@ZW4WeakCallbackType@2@@Z) referenced in function "public: virtual void __cdecl neon::BaseClassMetadata::construct(class v8::FunctionCallbackInfo<class v8::Value> const &)" (?construct@BaseClassMetadata@neon@@UEAAXAEBV?$FunctionCallbackInfo@VValue@v8@@@v8@@@Z)
I assume this is because of some deprecated functionality, or maybe a header just needs updating. I'm not quite sure. Could be related to #202 ?
If it's relevant, I'm compiling on Windows 10, with MSVC 2019.
FYI, this also fails in linux and on Node 11 due to a few breaking changes in v8.
@SirWaddles I wanted to clarify, is this happened when compiling (on $ neon build command) or when running the app (when $ electron index.js executed)? Since both happened when $ npm start executed on neon boilerplate..
In my case, it was when $ electron index.js. Therefor, the native module compilation has been successful, but the resulting binary (or dynamic library) is improper. I wonder if this was caused by my electron runtime..
This was fixed for me using the pull request mentioned above, alongside updating nan as mentioned in the PR comments.
Environment:
I have a similar issue. I would use node 12 version, but I couldn't.
This is an error log what I got
Welcome to Node.js v12.6.0.
Type ".help" for more information.
var adj =require("./lib")
undefined symbol: _ZNK2v86String10Utf8LengthEv
at Object.Module._extensions..node (internal/modules/cjs/loader.js:817:18)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:683:19)
at require (internal/modules/cjs/helpers.js:16:16)
I can compile it but I cannot use it.
It worked well when I downgrade my node version to 11.6
Should I wait for node 12 supporting?
I guess this problem is related to V8 on Node 12. Some functions are deprecated.
Could you give any suggestion?
@dev-jbam Take a look at this PR. There's a fork that you can reference that seems to fix the issue with Node 12. I'm hoping that it will get merged at some point so we don't have to rely on a fork for the fix.
@ernieturner Thank you very much, I changed my Cargo.toml
[build-dependencies]
neon-build = { git = "https://github.com/kjvalencik/neon",branch = "node12" }
[dependencies]
neon = { git = "https://github.com/kjvalencik/neon", branch = "node12" }
I tested it, it works well.
Thank you very much.