C++ 使用Poppler Qt4 c++;
我需要在我的应用程序中使用pdf查看器库, AM使用C++和QT 我下载了 和代码示例 但是,我不知道如何配置库以在我的代码中工作。 我正在windows xp中使用QT CreaterC++ 使用Poppler Qt4 c++;,c++,qt,pdf,poppler,C++,Qt,Pdf,Poppler,我需要在我的应用程序中使用pdf查看器库, AM使用C++和QT 我下载了 和代码示例 但是,我不知道如何配置库以在我的代码中工作。 我正在windows xp中使用QT Creater 提前感谢,如果您在系统上正确安装了poppler头和库,任何提示都将被视为我完全丢失。。我在ubuntu上运行: ./configure make make install 制作并安装poppler库。据我所知,您可以在windows上使用msys/mingw来实现类似的功能 现在在.pro文件中添加以下行:
提前感谢,如果您在系统上正确安装了poppler头和库,任何提示都将被视为我完全丢失。。我在ubuntu上运行:
./configure
make
make install
制作并安装poppler库。据我所知,您可以在windows上使用msys/mingw来实现类似的功能
现在在.pro
文件中添加以下行:
INCLUDEPATH += /path_to_poppler_include_files/qt4
LIBS += -L/path_to_poppler_libs -lpoppler-qt4
代码如下:
#include <poppler-qt4.h>
....
QString filename;
Poppler::Document* document = Poppler::Document::load(filename);
if (!document || document->isLocked())
{
// ...
delete document;
}
#包括
....
QString文件名;
Poppler::Document*Document=Poppler::Document::load(文件名);
如果(!document | | document->isLocked())
{
// ...
删除文件;
}
应该为您构建和运行
希望这有帮助,我编辑了
code
#包括code
。使用头文件的正确路径。目前我在QT creator中有此错误“::错误:找不到-lpoppler-qt4”。