我正在尝试使用V8和Node编译模块。我将它配置为dll并使用vcbuild.bat下载源代码和已编译的nodejs。
然而,它会抛出像
这样的错误错误2错误LNK2028:未解析的令牌(0A0005F6)“class v8 :: Handle __cdecl v8 :: True(void)”(?True @ v8 @@ $$ FYA?AV?$ Handle @ VBoolean @ v8 @@@ 1 @ XZ)在函数“public:static class v8 :: Handle __cdecl v8 :: Boolean :: New(bool)”中引用(?New @ Boolean @ v8 @@ $$ FSA?AV?$ Handle @ VBoolean @ v8 @ @@ @ 2 @ _N Z)
或
什么可能是错的?似乎与对象 HandleScope 相关错误6错误LNK2028:未解析的令牌(0A0005FE)“public:class v8 :: Local __thiscall V8 ::对象:: GetPropertyNames(无效)” (?GetPropertyNames @对象@ V8 @@ $$ FQAE?AV?$ @局部@ VARRAY V8 @@@ 2 @ XZ) 函数“class v8 :: Handle __cdecl”中引用 strin(class v8 :: Arguments const&)“ (?strin @@ $$ FYA?AV?$ Handle @ VValue @ v8 @@@ v8 @@ ABVArguments @ 2 @@ Z)c:\ Users \ aisha \ documents \ visual studio 2012 \ Projects \ Project2 \ Project2 \ EventLog.obj EventLog
答案 0 :(得分:0)
我在Windows上使用v8 dll构建了节点(VS2010)。我记录了我与大家分享的内容以及我的参考资料。包裹是这天来自git的新鲜克隆。
首先,您将v8构建为dll。我使用了本页中建议的BitCortex方法。 Build googles v8 as shared library on windows?
然后
0) Suppose you are at the root of the source tree. 1) edit vcbuild.bat (for a debug build) Line 15 set config=Release -> set config=Debug Line 18 set target_arch=ia32 -> set target_arch=x64 * target-arch should be the arch of your system. Line 92 python configure %debug_arg% %nosnapshot_arg% %noetw_arg% %noperfctr_arg% --dest-cpu=%target_arch% --tag=%TAG% -> python configure %debug_arg% %nosnapshot_arg% %noetw_arg% %noperfctr_arg% --dest-cpu=%target_arch% --tag=%TAG% --shared-v8 2) cp $(v8-dll-build)/include/*h ./src 3) cp $(v8-dll-build)/build/Debug/lib/v8.lib . 4) Build > vcbuild nosign 5) cp $(v8-dll-build)/build/Debug/*.dll Debug
这就是它的全部。