qtpdfium icon indicating copy to clipboard operation
qtpdfium copied to clipboard

Problem compile with QT 5.12.0 Mingw 32 Windows 10

Open amrkamal2025 opened this issue 6 years ago • 2 comments

Hello,

I tried to compile the library using QT 5.12.0 with Mingw32 compiler I followed this steps

1 - I open the qtpdfium.pro in release mode and I downloaded the PDFIUM third-party library and add it's content to the folder

2 - I compiled and I got this error so what the problem I did to not compile so I can fix it?

D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fsdk_actionhandler.cpp:425: error: 'class CPDF_Dest' has no member named 'GetObjectW'; did you mean 'GetObject'? const CPDF_Array* pMyArray = ToArray(MyDest.GetObject()); ^ D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:447: error: 'g_pdfium_print_postscript_level' was not declared in this scope g_pdfium_print_postscript_level = postscript_level; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fsdk_actionhandler.cpp:425: error: 'class CPDF_Dest' has no member named 'GetObjectW'; did you mean 'GetObject'? const CPDF_Array* pMyArray = ToArray(MyDest.GetObject()); ^ D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:681: error: no matching function for call to 'MakeUnique<<expression error> >(HDC__*&)' pContext->m_pDevice = pdfium::MakeUnique<CFX_WindowsDevice>(dc); ^ D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:681: error: template argument 1 is invalid pContext->m_pDevice = pdfium::MakeUnique<CFX_WindowsDevice>(dc); ^ D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:681: error: template argument 1 is invalid pContext->m_pDevice = pdfium::MakeUnique<CFX_WindowsDevice>(dc); ^ D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:681: error: template argument 1 is invalid pContext->m_pDevice = pdfium::MakeUnique<CFX_WindowsDevice>(dc); ^ D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:688: error: 'CFX_WindowsDevice' was not declared in this scope CFX_WindowsDevice WinDC(dc); ^~~~~~~~~~~~~~~~~ D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:689: error: 'WinDC' was not declared in this scope if (WinDC.GetDeviceCaps(FXDC_DEVICE_CLASS) == FXDC_PRINTER) { ^~~~~ D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:447: error: 'g_pdfium_print_postscript_level' was not declared in this scope g_pdfium_print_postscript_level = postscript_level; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:681: error: 'CFX_WindowsDevice' was not declared in this scope pContext->m_pDevice = pdfium::MakeUnique<CFX_WindowsDevice>(dc); ^~~~~~~~~~~~~~~~~ D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:681: error: no matching function for call to 'MakeUnique<<expression error> >(HDC__*&)' pContext->m_pDevice = pdfium::MakeUnique<CFX_WindowsDevice>(dc); ^ D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:681: error: template argument 1 is invalid pContext->m_pDevice = pdfium::MakeUnique<CFX_WindowsDevice>(dc); ^ D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:681: error: template argument 1 is invalid pContext->m_pDevice = pdfium::MakeUnique<CFX_WindowsDevice>(dc); ^ D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:681: error: template argument 1 is invalid pContext->m_pDevice = pdfium::MakeUnique<CFX_WindowsDevice>(dc); ^ D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:688: error: 'CFX_WindowsDevice' was not declared in this scope CFX_WindowsDevice WinDC(dc); ^~~~~~~~~~~~~~~~~ D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:689: error: 'WinDC' was not declared in this scope if (WinDC.GetDeviceCaps(FXDC_DEVICE_CLASS) == FXDC_PRINTER) { ^~~~~

amrkamal2025 avatar Jan 10 '19 15:01 amrkamal2025

I have the same bug.

It seems that part of the code that isn't supposed to be compiled is being compiled. There's a define FXM_PLATFORM which by default has QT value, it happens to govern if file containing CFX_WindowsDevice definition is included. However this only happens if FXM_PLATFORM equal to FXM_PLATFORM_WINDOWS which is not the case by default.

Question to author? What should be the value of FXM_PLATFORM on WIndows 10?????

Arsakes avatar Feb 23 '19 12:02 Arsakes

Do you have solved this preblem, i also have the same bug?

xinsuinizhuan avatar Jan 08 '21 01:01 xinsuinizhuan