0

I built podofo-0.9.2 using the standard cmake and make install procedure. I have include files in the /usr/include/podofo directory. I added it to my path. Then I tried to compile the podofotxtextract example by using the following syntax.

cd podofo/tools/podofotxtextract
g++ -c -Wall TextExtractor.cpp TextExtractor.h podofotxtextract.cpp -lpodofo -lfreetype
-lfontconfig -ljpeg -lz

But for some reason the compilation fails saying :

podofo.h - no such file or directory

This is the value of my path

/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/include/podofo

Maybe I'm missing something. I have linked the libraries. I have even included it in the path. What am I missing?

2 Answers2

1

Use the I option to add your podofo.h 'findable' by the g++ (see this, may help).

g++ -c -Wall -I/my/path/to/podofo/h TextExtractor.cpp TextExtractor.h podofotxtextract.cpp -lpodofo -lfreetype -lfontconfig -ljpeg -lz

Community
  • 1
  • 1
wesley.mesquita
  • 795
  • 5
  • 12
1

I think that you miss the -I to set the include path. It's a compilation error, not a linker one.

-I/path/to/dir/of/podofo
opatry
  • 131
  • 4
  • Thanks! Is it possible to somehow get around this error? Can't I add this to some file? (I added the directory to $PATH : the include file resides in /usr/include/podofo, but somehow it is unable to find it there). Thanks again. – Aditya Kumar Praharaj Feb 04 '14 at 10:58
  • The `$PATH` is not expected to handle includes, please refer to [GCC Environment Variables Reference](http://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html) for further details. As your dependency, you can use CMake (and the `include_directories` + `find_package`) to automate this. – opatry Feb 04 '14 at 11:16