[poppler] How to build poppler with Qt wrapper (POSIX)?

Albert Astals Cid aacid at kde.org
Wed Aug 29 09:42:11 PDT 2012


El Dimarts, 28 d'agost de 2012, a les 18:43:44, Ярослав Перминов va escriure:
> I need a pdf support with Qt 4.7.1 in my QNX 6.5.0, installed to
> VMWare Workstation. I try to build poppler ver.0.20.3
> (poppler.freedesktop.org) in next few steps (GCC 4.4.2.):
> 
> 0) Configure, build and install all dependencies of poppler
> (Fontconfig-2.10.1, Cairo-1.12.2, libjpeg-8d and libpng-1.5.12).
> 
> 1) Set proper environment variables to build poppler:
> 
> #!/bin/sh
> export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
> export CFLAGS="-I/usr/local/include/pixman-1 -I/usr/include/qt4
> -I/usr/pkg/include"
> export LDFLAGS="-L/usr/local/lib -L/x86/usr/lib -L/usr/lib -L/usr/pkg/lib"
> export LIBS="-lpixman-1 -lQtGui -lQtCore -lQtNetwork -lopenjpeg"
> export CXXFLAGS=${CFLAGS}
> export FREETYPE_CFLAGS=-I/usr/local/include/freetype2
> export FREETYPE_LIBS="-L/usr/local/lib -lfreetype"
> export FONTCONFIG_CFLAGS=-I/usr/local/include/fontconfig
> export FONTCONFIG_LIBS="-L/usr/local/lib -lfontconfig"
> export CAIRO_CFLAGS=-I/usr/local/include/cairo
> export CAIRO_LIBS="-L/usr/local/lib -lcairo"
> 
> 2) Unpack and configure it (see log file in the attachment):
> 
> # ./configure --disable-jpeg
> 
> 3) When I try to build poppler it fails with error in goo/gfile.cc:
> 
> # make
> make  all-recursive
> make[1]: Entering directory `/home/ftp/poppler-0.20.3'
> Making all in goo
> make[2]: Entering directory `/home/ftp/poppler-0.20.3/goo'
>   CXX    gfile.lo
> gfile.cc: In function 'GooString* getHomeDir()':
> gfile.cc:99: error: 'getuid' was not declared in this scope
> gfile.cc: In function 'GooString* getCurrentDir()':
> gfile.cc:121: error: 'getcwd' was not declared in this scope
> gfile.cc: In function 'GooString* makePathAbsolute(GooString*)':
> gfile.cc:437: error: 'getcwd' was not declared in this scope
> gfile.cc: In function 'std::time_t getModTime(char*)':
> gfile.cc:455: error: no matching function for call to
> 'stat::stat(char*&, stat*)'
> /usr/qnx650/target/qnx6/usr/include/sys/stat.h:133: note: candidates
> are: stat::stat()
> /usr/qnx650/target/qnx6/usr/include/sys/stat.h:133: note:
>    stat::stat(const stat&)
> gfile.cc: In function 'GBool openTempFile(GooString**, std::FILE**,
> const char*)':
> gfile.cc:531: error: 'mkstemp' was not declared in this scope
> gfile.cc: In constructor 'GDirEntry::GDirEntry(char*, char*, GBool)':
> gfile.cc:715: error: no matching function for call to 'stat::stat(char*,
> stat*)' /usr/qnx650/target/qnx6/usr/include/sys/stat.h:133: note:
> candidates are: stat::stat()
> /usr/qnx650/target/qnx6/usr/include/sys/stat.h:133: note:
>    stat::stat(const stat&)
> make[2]: *** [gfile.lo] Error 1
> make[2]: Leaving directory `/home/ftp/poppler-0.20.3/goo'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/home/ftp/poppler-0.20.3'
> make: *** [all] Error 2
> 
> -
> Functions getuid(), getcwd() and getcwd() are in my <pwd.h> file, but
> their declarations are covered by macros:
> 
> #ifdef __EXT_POSIX1_198808
> 	/* declarations */
> #endif
> 
> Error with stat::stat(char*&, stat*) because g++ trying to call struct
> constructor instead of call function stat(char*&, stat*), that
> declared in <sys/stat.h>.
> 
> Declaration of mkstemp() in <stdlib.h> is macro protected too:
> 
> #if defined(__EXT_XOPEN_EX)
> 	/* declarations */
> #endif
> 
> I tried to build poppler in Win7 (msys+MinGW) and everything was ok,
> it's works. Poppler binaries for pkgsrc from ftp.netbsd.org are
> without \Splash\ support, but I need this backend.
> 
> Define macros manually in $CFLAGS ("... -D__EXT_XOPEN_EX
> -D__EXT_POSIX1_198808") did not solve my problem.
> 
> -
> So, my questions:
> 
> 1) What is the correct way to set POSIX version in headers?
What do you mean with "set POSIX version in headers"?

> 2) Why stat() function can't be called?
Probably a few includes missing in gfile.cc

> 3) What I need to do to define __EXT_XOPEN_EX macro?
No clue, ask someone with QNX eperience?

Cheers,
  Albert

> 
> Thanks.


More information about the poppler mailing list