1

尝试在链接 1 处运行代码时出现以下错误。请帮助解决此问题

链接 1:https ://developers.google.com/v8/get_started#audience

------------------------------------错误开始------------ --------------------------

amit-macbook:v8 amit.sood$ g++ -Iinclude hello_world.cpp -o hello_world -Wl,--start-group out/x64.release/obj.target/{tools/gyp/libv8_{base,libbase.x64,snapshot},third_party/icu/libicu{uc,i18n,data}}.a -Wl,--end-group -lrt

clang: error: no such file or directory: 'out/x64.release/obj.target/tools/gyp/libv8_base.a'

clang: error: no such file or directory: 'out/x64.release/obj.target/tools/gyp/libv8_libbase.x64.a'

clang: error: no such file or directory: 'out/x64.release/obj.target/tools/gyp/libv8_snapshot.a'

clang: error: no such file or directory: 'out/x64.release/obj.target/third_party/icu/libicuuc.a'

clang: error: no such file or directory: 'out/x64.release/obj.target/third_party/icu/libicui18n.a'

clang: error: no such file or directory: 'out/x64.release/obj.target/third_party/icu/libicudata.a'

------------------------------------错误结束------------ --------------------------

我使用下面的链接 2 安装了 V8。我安装了它的 64 位版本

链接 2:https ://code.google.com/p/v8/wiki/BuildingWithGYP

4

2 回答 2

1

在我的机器上成功使用 v8 之后,我在这里整理了一份在 Mac OSX 上构建 v8 的指南 - 如果这对你有用,请告诉我,希望得到反馈:https ://gist.github.com/netpoetica/28ce31478cfc43edcaa7

此外,特别是关于您的问题:这里有几种可能性。首先,确保你确实有一个 /out 目录——它会在调用make. 接下来,当您调用 时make,您可能实际上并未创建名为 out/x64 的文件夹。相反,您可能(可能)已经调用make native或可能make ia32 -j 2或类似的东西 - 文件夹名称 x64.release 只有在您使用 make 时才应该存在:

make x64 // or make x64.release

于 2014-07-12T22:16:47.867 回答
0

您需要构建 v8 并将静态库标志设置为True. 这可以如下进行。

通过运行 gn args out.gn/x64.release 编辑默认构建配置。在配置中添加两行:is_component_build = false 和 v8_static_library = true

在这一步之后,常规ninja -C out.gn/x64.release应该为您提供所需的库

来源:https ://github.com/v8/v8/wiki/Getting%20Started%20with%20Embedding#run-the-example

于 2018-02-12T01:56:31.450 回答