I'm relatively new to programming in C++ and while I have some experience in general coding practices, conventions etc... Recently I have come to precipice of my (limited) knowledge.
Basically I wish to write a program that will allow me to extract the annotations from a PDF file. With some research I discovered that the Poppler library would allow me to do this. So I downloaded it and began the arduous process of building it for CodeBlocks (MinGW) on Windows Vista.
For those interested, the following site provided invaluable information with regards to the building of Poppler with Cmake:
http://www.seppemagiels.com/blog/building-poppler-windows-using-mingw>
Anyway, onto my current dilemma. Having followed the out of source conventions of Cmake I have a file structure like so:
...\Work\
..............poppler-0.22.2
..............poppler-0.22.2_Build
In the "poppler-0.22.2_Build" folder there is a " libpoppler.dll.a " file which i have been led to believe is a Library folder. I have then followed the instructions as described here:
http://www.learncpp.com/cpp-tutorial/a3-using-libraries-with-codeblocks/
I then linked to the libpoppler.dll.a file in the "poppler-0.22.2_Build" directory and the .h files which were in the original source directory (i.e. poppler-0.22.2).
Now my question is what do i need to write in my main.cpp such that i can use the Poppler functionality. At first i just wrote:
#include "poppler.h"
However, this returned with a "No such file or directory" error. Then i tried:
#include "poppler-qt4.h"
This then executed however I was informed later in my code that "poppler" has not been declared. Then I tried:
#include "poppler-qt4.h"
#include "C:\Users\...\poppler-0.22.2\cpp\poppler-document.h"
Which then returned a "undefined reference to 'imp_ZN7poppler8document14load_from_fileERKsS2_S2_'" error...
So that's where I am right now, I have absolutely no idea how I should continue and I was hoping someone could walk me through the steps I need to take to get Poppler to work i.e. as in how do I get the library to link, if that is indeed the problem, or how do I overcome the "imp_" error. I really am at my wits end with this problem...
Thanks in advance for any help you can supply.
P.S. My main.cpp so far:
#include <iostream>
//#include "poppler.h"
#include "poppler-qt4.h"
#include "C:\Users\...\poppler-0.22.2\cpp\poppler-document.h"
using namespace std;
int main()
{
const string dir = "C:\\Users\\...\\TestPDF.pdf";
poppler::document *doc = poppler::document::load_from_file(dir)
return 0;
}