compilation from sources with poppler

Matthieu
2010-10-07
2012-10-17
  • Matthieu
    Matthieu
    2010-10-07

    Hi,

    Since the internal preview has been added like in TeXmaker, I get errors when
    compiling from the SVN sources.

    pdfdocumentwidget.h:47:25: error: poppler-qt4.h: No such file or directory
    

    Obviously I need to install some poppler libraries somewhere.
    Do you have any advice for that?
    If there are few libraries, couldn't they be added to the svn?

     
  • what system are you using ?

    You need to install poppler on your system.
    (http://poppler.freedesktop.org/).
    Ubuntu offers packages like libpoppler-qt4.
    Otherwise compilation on linux system seems to be simple.
    I don't know about windows or mac.

     
  • Matthieu
    Matthieu
    2010-10-07

    I am on a mac.
    Is there an option to compile texmakerx without the internal pdf viewer
    functionality, i.e. without poppler libraries?

     
  • at the moment, Benito has not implemented that.

     
  • okay, i have tried out the installation on OS X 10.5.

    First you need to install cmake (the configure script seems to be not as
    elaborate).
    Ready-to-use installer for cmake can be found on the cmake page.

    Then download the poppler-sources from poppler.freedesktop.org.
    Run "cmake ." in the terminal in the directory poppler-0.14...
    Then "make" and "sudo make install".
    After that there should be no problem compiling tmx, though ppc support has to
    be removed (texmakerx.pro , remove the term ppc when you find it)

     
  • Matthieu
    Matthieu
    2010-10-12

    Ok I could install poppler using cmake.

    When I try to compile TmX for the x86_64 architecture with the QT4.7 libraries
    I get this problem

    Undefined symbols:
      "_gzprintf", referenced from:
          _synctex_updater_new_with_output_file in synctex_parser.o
      "_gzclose", referenced from:
          _synctex_scanner_free in synctex_parser.o
          _synctex_updater_free in synctex_parser.o
          __synctex_buffer_get_available_size in synctex_parser.o
          _synctex_scanner_parse in synctex_parser.o
          ___synctex_open in synctex_parser.o
          _synctex_updater_new_with_output_file in synctex_parser.o
          _synctex_scanner_new_with_output_file in synctex_parser.o
      "_gzerror", referenced from:
          __synctex_buffer_get_available_size in synctex_parser.o
      "_gzopen", referenced from:
          ___synctex_open in synctex_parser.o
          ___synctex_open in synctex_parser.o
          ___synctex_open in synctex_parser.o
          ___synctex_open in synctex_parser.o
          _synctex_updater_new_with_output_file in synctex_parser.o
      "_gzread", referenced from:
          __synctex_buffer_get_available_size in synctex_parser.o
      "_gzseek", referenced from:
          __synctex_match_string in synctex_parser.o
      "_gztell", referenced from:
          __synctex_match_string in synctex_parser.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    make[1]: *** [texmakerx.app/Contents/MacOS/texmakerx] Error 1
    make: *** [release] Error 2
    

    Any idea?

     
  • is poppler compiled for 64 bit.
    Is the lib at the right place ? (texmakerx.pro: INCLUDEPATH +=
    /usr/local/include/poppler/qt4
    LIBS += -L/usr/local/lib ) ?

     
  • Matthieu
    Matthieu
    2010-10-12

    thanks for your help.
    poppler is compiled for 64 bits, I checked it using the command 'file' on the
    binaries it generated.
    The libraries are at the right place:

    ioapc69:qt4 matthieu$ pwd & ls
    /usr/local/include/poppler/qt4
    poppler-annotation.h        poppler-form.h          poppler-optcontent.h        poppler-qt4.h
    poppler-export.h        poppler-link.h          poppler-page-transition.h
    
     
  • I think these errors has nothing to do with poppler.
    It looks more like missing c libraries.

     
  • Matthieu
    Matthieu
    2010-10-12

    On my machine I do have a library that defines 'gzprinft' etc.
    It is in /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Kernel.frame
    work/Versions/A/Headers/libkern/zlib.h
    It doesn't help if I add "#include <zlib.h>" in synctex_parser.c .
    I also get some warnings:

    ld: warning: directory '/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib' following -L not found
    ld: warning: directory '/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib' following -F not found
    

    Can they be related?

     
  • That is probably the point.
    But ld tries to link tmx to that library and you need to specify the place
    where the compiled lib is found (under linux zlib is called libzlib.la)
    The location can be specief in the texmakerx.pro with LIBS +=
    -l/...location../zlib (as it was done for poppler)

     
  • Matthieu
    Matthieu
    2010-10-15

    thanks for your help, this was the point. I added

        LIBS += -L/usr/local/lib \
            -lz
    

    in texmakerx.pro and it compiled.

     
  • Matthieu
    Matthieu
    2010-10-17

    I have a comment and a question regarding Revision 1332 that seems to address
    the issue I had.

    -> Comment:
    With the previous comment I might have induced and error. In Mac OS 10.6 and
    probably previous versions, the standard zlib compiled libraries can be found
    in "/usr/lib". I did recompile the libraries that is why they where located
    elsewhere.
    I can confirm that when I change lines around 462 in texmakerx.pro into

            LIBS += -L/usr/local/lib -lpoppler-qt4 -lpoppler
            LIBS += -L/usr/lib -lz
    

    The project compiles correctly.

    -> Question:
    In item 6 in this discussion I reported some compilation errors that looked
    like being related to synctex. What is the link with zlib and poppler?

     
  • synctex requires zlib.
    poppler itself automatically finds zlib (as it is a compiled lib already)

     
  • Matthieu
    Matthieu
    2010-10-17

    As far as I remember my problem of compilation showing libz errors involving
    synctex appeared when the poppler dependency was introduced.

     
  • yes, because synctex is used for forward/inverse search to/from the pdf in the
    internal viewer. It was introduced when poppler was adapted from texworks...