静态链接V8
Linking V8 Statically
我有一个动态地与V8完美配合的项目,但我想静态地嵌入它。我可以成功地将V8编译为静态,但当我将生成的库包含在C++项目中时(我也将其更改为静态链接),我会收到这样的错误:
Error 12 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall v8::HandleScope::HandleScope(class v8::Isolate *)" (__imp_??0HandleScope@v8@@QAE@PAVIsolate@1@@Z)
我还有许多其他错误。我看到一些帖子提到v8.lib,但它并不存在。但是,有一个v8.obj文件。
任何见解都将是最受欢迎的,谢谢。
发现问题。它实际上在v8.h文件的顶部有明确的说明:
// Setup for Windows DLL export/import. When building the V8 DLL the
// BUILDING_V8_SHARED needs to be defined. When building a program which uses
// the V8 DLL USING_V8_SHARED needs to be defined. When either building the V8
// static library or building a program which uses the V8 static library neither
// BUILDING_V8_SHARED nor USING_V8_SHARED should be defined.
我仍然定义了"USING_V8_SHARED"。感谢@drescherjm为我指明了正确的方向。)
相关文章:
- lambda参数转换为constexpr技巧,然后获取带链接的数组
- CMake-按正确顺序将项目与C运行时对象文件链接
- 从链接列表c++中删除一个项目
- 有根的二进制搜索树.保留与其父级的链接
- 读取文件的最后一行并输入到链接列表时出错
- 静态数据成员的问题-修复链接错误会导致编译器错误
- node-gyp 在 macOS 上未正确链接库
- 基于boost的程序的静态链接——zlib问题
- 无法链接 CMake 中的本地库
- 内联函数中具有内部链接的全局变量
- 链接阶段在Ubuntu上失败,但在MacOS上失败
- 使用gcc从静态链接的文件中查找可选符号
- 我可以将一个用clang c++11编译的对象与另一个用c++17编译的对象链接起来吗
- 将--whole archive链接器选项与CMake和具有其他库依赖项的库一起使用
- v8 你好世界示例链接错误
- 静态链接V8
- 如何在Visual Studio c++项目中链接使用google v8所需的库
- Android NDK链接V8静态库:找不到符号,但它们在那里
- 链接V8时未定义的引用
- 使用v8的共享库与静态链接的v8不兼容