c++ - Chrome V8 示例编译错误,我该如何解决“remove_cv_t”不是“std”的成员?
问题描述
我正在尝试运行示例:
g++ -I. -Iinclude samples/hello-world.cc -o hello_world -lv8_monolith -Lout.gn/x64.release/obj/ -lrt -ldl -pthread -std=c++0x -DV8_COMPRESS_POINTERS
但我得到了错误:
In file included from ./include/v8.h:30:0,
from samples/hello-world.cc:10:
./include/v8-internal.h: In function ‘void v8::internal::PerformCastCheck(T*)’:
./include/v8-internal.h:452:33: error: ‘remove_cv_t’ is not a member of ‘std’
!std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
^
./include/v8-internal.h:452:33: error: ‘remove_cv_t’ is not a member of ‘std’
./include/v8-internal.h:452:50: error: template argument 2 is invalid
!std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
^
./include/v8-internal.h:452:61: error: ‘::Perform’ has not been declared
!std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
我真的很想使用 V8 引擎,但我什至无法编译示例。我希望我能得到你的帮助。太感谢了。
解决方案
-std=c++14
应该修复它。
(不幸的是,官方文档在这个微小但重要的细节上已经过时了。)
推荐阅读
- dependency-injection - Arrow KT:Reader Monad 与 @extension 的依赖注入
- mongoose - Mongoose:如何更新子嵌入文档数组?
- reactjs - 在 componentDidMount() 中的 react api 请求中设置标头
- php - 如何在laravel中验证电话号码?
- ios - 如何在 SwiftUI 视图中访问自己的窗口?
- sqlite - 设置带有 2 个实体错误的 android studio Room 数据库
- python - 我将用于扑克游戏但我得到两个奇怪的输出的python代码
- java - putParcelableArrayListExtra 有大小限制吗?
- java - 为什么我的@FunctionalInterface 使用两种方法没有编译错误?
- html - 缩小屏幕以检查响应能力后,按钮无法正确显示 - HTML/CSS