且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何链接到v8?

更新时间:2023-11-13 13:00:46

Visual Studio项目 v8 / sample / hello-world.vcxproj code> v8 / build / samples / samples.gyp 所有必要的依赖关系。

Visual Studio project v8/sample/hello-world.vcxproj has been generated with GYP from v8/build/samples/samples.gyp with all necessary dependencies.

在当前版本的入门文章,在运行示例部分中,项目列表#3包含构建hello_world的命令行示例:

In the current version of "Getting started" article, in "Run example" section, item list #3 contains an example of command line to build the hello_world:


编译hello_world.cpp ,链接到在
中创建的静态库的构建过程。例如,在使用GNU编译器的64位Linux上:

Compile hello_world.cpp, linking to the static libraries created in the build process. For example, on 64bit Linux using the GNU compiler:



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

在Windows上,您需要使用类似的静态库列表作为链接器输入。请注意,这些静态库位于 v8 / build / Release / lib 目录中。

On Windows you need to use the similar list of static libraries as a linker input. Please note these static libraries are placed in v8/build/Release/lib directory.