Answer the question
In order to leave comments, you need to log in
Using Win32 version of Poppler-qt4?
I downloaded poppler from windows.kde.org and got two problems.
1. How to make poppler-qt4 static lib? The devel version comes with lib, which is a wrapper for dll (and you don’t want to drag dlls around with you), if you build it yourself in a static library configuration and with the /MT switch, either one still requires a dll at startup.
2. When I try to build an example
#include <poppler-qt4.h><br/>
<br/>
QString filename;<br/>
Poppler::Document* document = Poppler::Document::load(filename);<br/>
if (!document || document->isLocked()) {<br/>
delete document;<br/>
return;<br/>
}<br/>
if (document == 0) {<br/>
return;<br/>
}<br/>
Poppler::Page* pdfPage = document->page(pageNumber); // Document starts at page 0<br/>
if (pdfPage == 0) {<br/>
return;<br/>
}<br/>
QImage image = pdfPage->renderToImage();<br/>
if (image.isNull()) {<br/>
return;<br/>
}<br/>
<br/>
// ... use image ...<br/>
<br/>
// after the usage, the page must be deleted<br/>
delete pdfPage;<br/>
delete document;
Answer the question
In order to leave comments, you need to log in
1. /MT is responsible for the fact that we link statically standard MS'a libs, and this does not affect Qt in any way. In order to change the type of linking, you need to change the type of the project, and put the Static Library.
That is, you build poppler
as a static library, then link your project, static Q
t and the resulting static poppler
, and when you run it crashes, requiring some kind of DLL?
If so, then look through dumpbin /imports
( help ) which DLLs your built project imports. If there is some kind of DLL there, look at the build log - there, accordingly, there should also be a static wrapper for this DLL. Or, if there's nothing there, maybe in the sources poppler
'a - MS allows you to specify the library at the source level with pragma comment
( help). In any case, this static wrapper must be somewhere in the vicinity, otherwise the project would not build. You need to disable it in the project settings - explicitly, or, if it is written in the source code, then through /NODEFAULTLIB:<name>
.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question