1

使用 Git中所述下载的代码:

fetch v8
cd v8

按照 BuildingWithGYP中的描述构建

gclient sync
make x64.release

更新到最新的master,并使用了一个示例:

git checkout master
git pull

但是当按照Get Started中的描述构建一个示例时,我遇到了一个错误

g++ -I. hello_world.cc -o hello_world -Wl,--start-group out/x64.release/obj.target/{tools/gyp/libv8_{base,libbase,snapshot,libplatform},third_party/icu/libicu{uc,i18n,data}}.a -Wl,--end-group -lrt -pthread -std=c++0x

g++: error: out/x64.release/obj.target/tools/gyp/libv8_snapshot.a: No such file or directory

事实证明没有这样的文件:

$ find . -name *snapshot*.a
./out/x64.release/obj.target/tools/gyp/libv8_nosnapshot.a
./out/x64.release/obj.target/tools/gyp/libv8_external_snapshot.a

所以问题是,我做错了什么?

4

1 回答 1

0

似乎是因为不稳定的版本。 https://groups.google.com/forum/#!topic/v8-users/SBAGmGr7eBg

根据上面的这个链接:

“Getting Started 只兼容当前的 Stable 版本。我目前正在更新它以兼容 4.4 版本。”

所以我们可以签出像 4.4 这样的稳定​​版本

git checkout -b 4.4 -t branch-heads/4.4

然后继续其余步骤。

但是注意到 hello-world.cc 存在于 4.5 版本中,所以我们可以先下载示例。

以下是我从链接中复制的步骤:

Goto v8/ git checkout -b 4.5 -t branch-heads/4.5 Copy samples/hello-world.cc to v8/ git checkout -b 4.4 -t branch-heads/4.4 gclient sync make x64.release snapshot=off g++ -I. hello-world.cc -o hello_world -Wl,--start-group out/x64.release/obj.target/{tools/gyp/libv8_{base,libbase,nosnapshot,libplatform},third_party/icu/libicu{uc,i18n,data}}.a -Wl,--end-group -lrt -ldl -pthread -std=c++0x ./hello_world

于 2015-11-25T06:13:55.773 回答