【发布时间】:2020-09-03 17:53:45
【问题描述】:
我在 Windows 上的 C:\repo\pdfium\out\debug\obj\test 目录中有 main.cpp。 Pdfium.lib 在 obj 目录下。
#include <stdio.h>
#include <fpdfview.h>
int main() {
FPDF_InitLibrary();
FPDF_DestroyLibrary();
printf("PDFium hello.\n");
return 0;}
pdfium.lib 是用 GCC 构建的(is_lang=false)
使用命令我正在生成 main.o
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
g++.exe -o bin\Debug\test.exe obj\Debug\main.o ..\pdfium.lib
但我正在服用...
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 上没有链接。 任何建议都是有效的。
谢谢
吉姆
【问题讨论】:
-
我一直在尝试在 MSYS2 下使用 MinGW-w64 构建 pdfium,它似乎使用
gn作为构建工具。我的系统上有gn,但我似乎无法让它配置/构建项目。你如何构建 pdfium? -
@BrechtSanders 如果您仍然对答案感兴趣,可能值得在自己的问题中提出这个问题。