我正在努力用 V8 编译一个非常小的示例 ..
cpp程序是这样的:
#include "v8.h"
int main()
{
v8::HandleScope handle_scope;
return 0;
}
编译行:g++ -I/home/lterje/git/tengine/Externals/v8/include /home/lterje/git/tengine/Externals/v8/out/ia32.release/obj.target/tools/gyp/libv8_snapshot.a test.cpp -o 测试 -lpthread
我得到的错误:
/tmp/ccHYtJuE.o: In function `main':
test.cpp:(.text+0x11): undefined reference to `v8::HandleScope::HandleScope()'
test.cpp:(.text+0x22): undefined reference to `v8::HandleScope::~HandleScope()'
collect2: error: ld returned 1 exit status
基本、快照和无快照库文件之间到底有什么区别?我已经尝试与它们中的每一个链接,但它们都不起作用:/