我正在努力弄清楚如何在Windows上构建Google的V8。
到目前为止,我有:
fetch v8
gn gen --ide=vs2015 out/Default
我的问题是,这只会产生大量.obj
个文件,而不会产生.lib
个文件。
我已将项目(v8,v8_base,v8_libbase等)设置为Configuration type: Static library (.lib)
:
我不确定如何让Visual Studio生成库文件。任何帮助表示赞赏!
我已设法使用以下步骤生成库文件:
v8_base
,v8_libbase
,v8_external_snapshot
和v8_libplatform
的obj文件的目录。.lib
命令手动构建lib
,例如lib /o:v8_base *.obj
icui18n.lib
和icuuc.lib
一起复制到一个目录中(这些在构建期间创建得很好。)我现在正试图实际使用这些库并遇到一个新问题,我将不胜感激。
我在VS中链接了以下库:v8_base.lib; v8_libbase.lib; v8_external_snapshot.lib; v8_libplatform.lib; icui18n.lib; icuuc.lib; winmm.lib;
,但是我遇到了一些未解决的符号问题:
unresolved external symbol "public: static void __cdecl v8::sampler::Sampler::TearDown(void)" (?TearDown@Sampler@sampler@v8@@SAXXZ) referenced in function "public: static void __cdecl v8::internal::V8::TearDown(void)" (?TearDown@V8@internal@v8@@SAXXZ) TriviaBot v8_base.lib(v8.obj)
unresolved external symbol "public: void __cdecl v8::sampler::Sampler::Stop(void)" (?Stop@Sampler@sampler@v8@@QEAAXXZ) referenced in function "private: void __cdecl v8::internal::Isolate::Deinit(void)" (?Deinit@Isolate@internal@v8@@AEAAXXZ) v8_base.lib(isolate.obj)
unresolved external symbol "public: void __cdecl v8::sampler::Sampler::Stop(void)" (?Stop@Sampler@sampler@v8@@QEAAXXZ) v8_base.lib(log.obj)
unresolved external symbol "public: __cdecl v8::sampler::Sampler::Sampler(class v8::Isolate *)" (??0Sampler@sampler@v8@@QEAA@PEAVIsolate@2@@Z) referenced in function "public: __cdecl v8::internal::Ticker::Ticker(class v8::internal::Isolate *,int)" (??0Ticker@internal@v8@@QEAA@PEAVIsolate@12@H@Z) v8_base.lib(log.obj)
unresolved external symbol "public: __cdecl v8::sampler::Sampler::Sampler(class v8::Isolate *)" (??0Sampler@sampler@v8@@QEAA@PEAVIsolate@2@@Z) v8_base.lib(cpu-profiler.obj)
unresolved external symbol "public: virtual __cdecl v8::sampler::Sampler::~Sampler(void)" (??1Sampler@sampler@v8@@UEAA@XZ) referenced in function "public: virtual void * __cdecl v8::internal::Ticker::`scalar deleting destructor'(unsigned int)" (??_GTicker@internal@v8@@UEAAPEAXI@Z)
unresolved external symbol "public: virtual __cdecl v8::sampler::Sampler::~Sampler(void)" (??1Sampler@sampler@v8@@UEAA@XZ) v8_base.lib(cpu-profiler.obj)
unresolved external symbol "public: void __cdecl v8::sampler::Sampler::Start(void)" (?Start@Sampler@sampler@v8@@QEAAXXZ) referenced in function "public: void __cdecl v8::internal::Profiler::Engage(void)" (?Engage@Profiler@internal@v8@@QEAAXXZ) v8_base.lib(log.obj)
unresolved external symbol "public: void __cdecl v8::sampler::Sampler::IncreaseProfilingDepth(void)" (?IncreaseProfilingDepth@Sampler@sampler@v8@@QEAAXXZ) referenced in function "public: void __cdecl v8::internal::Profiler::Engage(void)" (?Engage@Profiler@internal@v8@@QEAAXXZ) v8_base.lib(log.obj)
unresolved external symbol "public: void __cdecl v8::sampler::Sampler::IncreaseProfilingDepth(void)" (?IncreaseProfilingDepth@Sampler@sampler@v8@@QEAAXXZ) v8_base.lib(cpu-profiler.obj)
unresolved external symbol "public: void __cdecl v8::sampler::Sampler::DecreaseProfilingDepth(void)" (?DecreaseProfilingDepth@Sampler@sampler@v8@@QEAAXXZ) referenced in function "public: void __cdecl v8::internal::Profiler::Disengage(void)" (?Disengage@Profiler@internal@v8@@QEAAXXZ) v8_base.lib(log.obj)
unresolved external symbol "public: void __cdecl v8::sampler::Sampler::DecreaseProfilingDepth(void)" (?DecreaseProfilingDepth@Sampler@sampler@v8@@QEAAXXZ) v8_base.lib(cpu-profiler.obj)
unresolved external symbol "public: void __cdecl v8::sampler::Sampler::DoSample(void)" (?DoSample@Sampler@sampler@v8@@QEAAXXZ) referenced in function "public: virtual void __cdecl v8::internal::SamplingThread::Run(void)" (?Run@SamplingThread@internal@v8@@UEAAXXZ) v8_base.lib(log.obj)
unresolved external symbol "public: void __cdecl v8::sampler::Sampler::DoSample(void)" (?DoSample@Sampler@sampler@v8@@QEAAXXZ) v8_base.lib(cpu-profiler.obj)
unresolved external symbol "public: static void __cdecl v8::sampler::Sampler::SetUp(void)" (?SetUp@Sampler@sampler@v8@@SAXXZ) referenced in function "private: static void __cdecl v8::internal::V8::InitializeOncePerProcessImpl(void)" (?InitializeOncePerProcessImpl@V8@internal@v8@@CAXXZ) v8_base.lib(v8.obj)
所有错误似乎与v8::sampler
有关 - 再次感谢任何帮助!
答案 0 :(得分:2)
看起来我又回答了自己的问题。我希望我在问题中列出的信息对于那些与我这样的过时文档挣扎的人都有用。
我的更新涵盖了所有必需的内容,除了我甚至没有注意到v8_libsampler
项目并忘记为其生成库文件这一事实。一旦我这样做并将其链接起来,我就开始运行了!
答案 1 :(得分:1)
就像你一样,我正在尝试不同的设置来获得lib构建。这是我的步骤:
答案 2 :(得分:0)
我已经完成了类似的配置,但对于VS2013和运行忍者来构建一切。 Build已经产生了我的一组DLL,包括v8.dll,我完全没问题。