ubuntu 中的 V8 安装

V8 installation in ubuntu

我已按照以下步骤在 ubuntu 中安装 v8。过程中没有发生错误

svn checkout http://v8.googlecode.com/svn/trunk/ ./v8
cd v8
make builddeps
make native

但是当我尝试使用以下命令 运行 hello world 程序时出现错误

 g++ -Iv8/include hello_world.cpp -o hello_world.o
v8/out/native/obj.target/tools/gyp/libv8_base.a 

v8/out/native/obj.target/tools/gyp/libv8_snapshot.a -lpthread

错误是

g++: error: v8/out/native/obj.target/tools/gyp/libv8_base.a: No such file or directory
g++: error: v8/out/native/obj.target/tools/gyp/libv8_snapshot.a: No such file or directory

在不知道您的文件夹结构的情况下,您似乎已经在 v8 文件夹中,因此请尝试将您的命令更改为:

g++ -Iv8/include hello_world.cpp -o hello_world.o
out/native/obj.target/tools/gyp/libv8_base.a 
out/native/obj.target/tools/gyp/libv8_snapshot.a -lpthread

您只需运行程序使用以下命令!!

g++ hello_world.cpp -o hello_world.o -lv8

:)