Bug 12493 - No localtime_r and gcc instead of g++
Summary: No localtime_r and gcc instead of g++
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: glib frontend (show other bugs)
Version: unspecified
Hardware: Other Cygwin
: medium minor
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 14024
  Show dependency treegraph
 
Reported: 2007-09-19 13:25 UTC by Émilien Tlapale
Modified: 2008-01-11 08:30 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Small patch (1.39 KB, patch)
2007-10-25 11:14 UTC, Albert Astals Cid
Details | Splinter Review

Description Émilien Tlapale 2007-09-19 13:25:32 UTC
Hi!
I am still using poppler in cross-compiling for windows so there are two minor bugs in 0.6. Or maybe it is just a misconfiguration on my laptop. Anyway.

There seem to be no localtime_r on my i686-mingw32 toolchain. I suppose a check might be needed and a HAVE_LOCALTIME_R added. In glib/test-poppler-glib.c the function is used into poppler_format_date(GTime), so maybe just some #if/#else would be nice. I replaced the `struct tm t;`  with `struct tm *t;` and `!localtime (&time, &t)` with `!(t = localtime (&time))` but i have absolutely no idea of the meaning.

Yet another problem while compiling is a `/bin/sh ../libtool --tag=CC --mode=link i686-mingw32-gcc ... -o test-poppler-glib.exe  test-poppler-glib.o ...` which gives many unresolved symbols. I replaced it with a `... --tag=CC --mode=link i686-mingw32-g++ ...` to compile.

Seems nothing at all and thanks a lot for this useful library :)
Comment 1 Émilien Tlapale 2007-10-25 02:21:45 UTC
Hi! I am compiling the new poppler 0.6.1 using Ubuntu's mingw32 (cross-compiler for windows) and I got exactly the same problems :

1. There is a `i586-mingw32msvc-gcc' command which gives undefined references to standard C++ things, so a `i586-mingw32msvc-g++' is necessary while building `test-poppler-glib.exe'. For instance:
 poppler-0.6.1/poppler/.libs/libpoppler.a(Function.o):Function.cc:(.text+0x6d3c): undefined reference to `operator new(unsigned int)'

2. Maybe I am missing something but `localtime_r' is still undefined with my Ubuntu mingw32 installation, as with crossdev on Gentoo. So I suggest to add a HAVE_LOCALTIME_R and a line like:

if (time == 0 || localtime (&time)) return NULL;

in glib/test-poppler-glib.c

Thanks a lot!

--
Émilien TLAPALE
Comment 2 Albert Astals Cid 2007-10-25 11:14:36 UTC
Created attachment 12194 [details] [review]
Small patch

Please apply the attached patch and see if renaming test-poppler-glib.c to test-poppler-glib.cc and changing
test_poppler_glib_SOURCES =                     \
       test-poppler-glib.c
to
test_poppler_glib_SOURCES =                     \
       test-poppler-glib.cc
in Makefile.am fixes your problems.
Comment 3 Émilien Tlapale 2007-10-25 11:35:21 UTC
This indeed solves the compilation problems.
Thanks :)
Comment 4 Albert Astals Cid 2007-10-25 12:00:17 UTC
fixed on git


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.