2015-02-24 90 views

回答

3

要将std :: string转换为v8 :: Local < v8 :: String >,则不需要编译和运行脚本。只是这样做:

std::string sText = "whatever"; 
v8::Local<v8::String> hTextJS = v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), sText.c_str()) 
+0

我得到这个错误:“NewFromUtf8”不是成员“V8 ::字符串” – JaisoN 2015-02-25 04:52:26

+0

V8 ::字符串:: NewFromUtf8是最迟在https://github.com/ V8/V8 /斑点/主/包含/ v8.h。也许你有一个旧版本?如果您使用的是较早版本,则可能只会调用v8 :: String :: New。 – 2015-02-26 23:47:00

+0

谢谢先生:) – JaisoN 2015-04-15 07:12:21

相关问题