首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何解决windows 10上的pdfium链接问题

如何解决windows 10上的pdfium链接问题
EN

Stack Overflow用户
提问于 2020-09-03 17:53:45
回答 1查看 245关注 0票数 0

Windows上的main.cpp位于C:\repo\pdfium\out\debug\obj\test目录。Pdfium.lib在obj目录下。

代码语言:javascript
复制
#include <stdio.h>
#include <fpdfview.h>
int main() {
FPDF_InitLibrary();
FPDF_DestroyLibrary();
printf("PDFium hello.\n");
return 0;}

pdfium.lib是由GCC(is_lang=false)构建的

有了命令,我正在生产主机。

g++.exe -std=c++11 -g -I........\public -c C:\repo\pdfium\out\debug\obj\test\main.cpp -o obj\Debug\main.o

使用下面的命令,我正在尝试链接pdfium.lib

代码语言:javascript
复制
g++.exe  -o bin\Debug\test.exe obj\Debug\main.o   ..\pdfium.lib

但我要..。

代码语言:javascript
复制
Warning: corrupt .drectve at end of def file
..\pdfium.lib(obj/core/fpdfapi/parser/parser/fpdf_parser_utility.obj):(.xdata[$unwind$?_Makestr@_System_error@std@@CA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@Verror_code@2@V32@@Z]+0x8): undefined reference to `__GSHandlerCheck'

我尝试了这么多次,但没有在windows 10上链接。任何建议都将是救赎的。

谢谢

吉姆

EN

回答 1

Stack Overflow用户

发布于 2021-02-05 22:13:43

如果您使用非组件构建( PDFium中的is_component_build = false in args.gn)而不设置pdf_is_complete_lib = true,则生成的.lib文件将不包含它们的依赖项,因此很可能会让链接器抱怨缺少符号。尝试生成DLL (is_component_build = true)或设置pdf_is_complete_lib = true

如果使用组件构建,则需要将PDFium DLL及其依赖项(至少是zlib DLL,可能还有其他依赖项)打包到应用程序中。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63729197

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档