编译pdfium-master时,mingw老是报下面这些错误
PS D:\projectcode\PDFium-master\biuld> make fx_win32_c_all
compiling: fx_win32_device.o fx_win32_dib.o fx_win32_dwrite.o fx_win32_gdipext.o fx_win32_print.o
PS D:\projectcode\PDFium-master\biuld> make
../sdk/src/fpdf_dataavail.cpp: In member function 'virtual FX_BOOL CFPDF_FileAccessWrap::ReadBlock(void*, FX_INT32, size_t)':
../sdk/src/fpdf_dataavail.cpp:64:55: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
memcpy(buffer, m_pFileAccess->m_Param + offset, size);
~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
../sdk/src/fpdf_dataavail.cpp: In member function 'virtual FX_BOOL CPDF_CustomAccess::ReadBlock(void*, FX_INT32, size_t)':
../sdk/src/fpdf_dataavail.cpp:108:95: warning: no return statement in function returning non-void [-Wreturn-type]
virtual FX_BOOL ReadBlock(void *buffer, FX_FILESIZE offset, size_t size) FX_OVERRIDE {
}
^
fx_win32_device.o:fx_win32_device.cpp:(.text+0xf8): undefined reference to `__imp_CreateCompatibleDC'
fx_win32_device.o:fx_win32_device.cpp:(.text+0x250): undefined reference to `__imp_DeleteDC'
fx_win32_device.o:fx_win32_device.cpp:(.text+0x290): undefined reference to `__imp_CreateFontIndirectA'
fx_win32_device.o:fx_win32_device.cpp:(.text+0x3aa): undefined reference to `__imp_CreateFontIndirectA'
fx_win32_device.o:fx_win32_device.cpp:(.text+0x83f): undefined reference to `__imp_EnumFontFamiliesExA'
fx_win32_device.o:fx_win32_device.cpp:(.text+0x1c33): undefined reference to `__imp_CreateFontA'
fx_win32_device.o:fx_win32_device.cpp:(.text+0x1c5f): undefined reference to `__imp_SelectObject'
fx_win32_device.o:fx_win32_device.cpp:(.text+0x1c8c): undefined reference to `__imp_GetTextFaceA'
fx_win32_device.o:fx_win32_device.cpp:(.text+0x1cb0): undefined reference to `__imp_SelectObject'
fx_win32_device.o:fx_win32_device.cpp:(.text+0x1e3a): undefined reference to `__imp_DeleteObject'
fx_win32_device.o:fx_win32_device.cpp:(.text+0x202a): undefined reference to `__imp_CreateFontA'
fx_win32_device.o:fx_win32_device.cpp:(.text+0x216c): undefined reference to `__imp_DeleteObject'
fx_win32_device.o:fx_win32_device.cpp:(.text+0x21a4): undefined reference to `__imp_SelectObject'
fx_win32_device.o:fx_win32_device.cpp:(.text+0x2208): undefined reference to `__imp_GetFontData'
fx_win32_device.o:fx_win32_device.cpp:(.text+0x2223): undefined reference to `__imp_SelectObject'
fx_win32_device.o:fx_win32_device.cpp:(.text+0x2269): undefined reference to `__imp_SelectObject'
fx_win32_device.o:fx_win32_device.cpp:(.text+0x228d): undefined reference to `__imp_GetTextFaceA'
fx_win32_device.o:fx_win32_device.cpp:(.text+0x22a8): undefined reference to `__imp_SelectObject'
fx_win32_device.o:fx_win32_device.cpp:(.text+0x2300): undefined reference to `__imp_SelectObject'
fx_win32_device.o:fx_win32_device.cpp:(.text+0x231c): undefined reference to `__imp_GetTextMetricsA'
fx_win32_device.o:fx_win32_device.cpp:(.text+0x2334): undefined reference to `__imp_SelectObject'
fx_win32_device.o:fx_win32_device.cpp:(.text+0x281c): undefined reference to `__imp_SetStretchBltMode'
fx_win32_device.o:fx_win32_device.cpp:(.text+0x283a): undefined reference to `__imp_GetObjectType'
fx_win32_device.o:fx_win32_device.cpp:(.text+0x2870): undefined reference to `__imp_CreateBitmap'
fx_win32_device.o:fx_win32_device.cpp:(.text+0x288f): undefined reference to `__imp_SelectObject'
fx_win32_device.o:fx
PDFium编译错误修复: Mingw缺失Win32库链接

在尝试编译PDFium项目时,使用Mingw遇到了多个链接错误,主要涉及到Win32 API函数如`CreateCompatibleDC`、`DeleteDC`等未定义。解决方法是在makefile中添加`-lgdi32`链接库,确保编译成功并能正确调用Windows图形设备接口。
最低0.47元/天 解锁文章
9770





