Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1111372

Bug#1016219: clucene-core: FTBFS: DateTools.cpp:26:19: error: ‘gmtime’ was not declared in this scope

From Lucas Nussbaum <lucas@debian.org>
Newsgroups linux.debian.bugs.dist
Subject Bug#1016219: clucene-core: FTBFS: DateTools.cpp:26:19: error: ‘gmtime’ was not declared in this scope
Date 2022-07-29 18:50 +0200
Message-ID <EOBlv-eE8j-31@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Source: clucene-core
Version: 2.3.3.4+dfsg-1
Severity: serious
Justification: FTBFS
Tags: bookworm sid ftbfs
User: lucas@debian.org
Usertags: ftbfs-20220728 ftbfs-bookworm

Hi,

During a rebuild of all packages in sid, your package failed to build
on amd64.


Relevant part (hopefully):
> cd /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/core && /usr/bin/c++ -DMAKE_CLUCENE_CORE_LIB -Dclucene_core_EXPORTS -I/<<PKGBUILDDIR>>/src/shared -I/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/shared -I/<<PKGBUILDDIR>>/src/core -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -ansi -fvisibility=hidden -fvisibility-inlines-hidden -fPIC    -D_REENTRANT -D_UCS2 -D_UNICODE -MD -MT src/core/CMakeFiles/clucene-core.dir/CLucene/document/NumberTools.o -MF CMakeFiles/clucene-core.dir/CLucene/document/NumberTools.o.d -o CMakeFiles/clucene-core.dir/CLucene/document/NumberTools.o -c /<<PKGBUILDDIR>>/src/core/CLucene/document/NumberTools.cpp
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp: In static member function ‘static void lucene::document::DateTools::timeToString(int64_t, Resolution, TCHAR*, size_t)’:
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:26:19: error: ‘gmtime’ was not declared in this scope
>    26 |         tm *ptm = gmtime(&secs);
>       |                   ^~~~~~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:11:1: note: ‘gmtime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
>    10 | #include "CLucene/util/Misc.h"
>   +++ |+#include <ctime>
>    11 | 
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:31:30: error: ‘strftime’ was not declared in this scope
>    31 |                 size_t len = strftime(abuf, DATETOOLS_BUFFER_SIZE, "%Y%m%d%H%M%S", ptm);
>       |                              ^~~~~~~~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:31:30: note: ‘strftime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:35:17: error: ‘strftime’ was not declared in this scope
>    35 |                 strftime(abuf, DATETOOLS_BUFFER_SIZE, "%Y%m%d%H%M%S", ptm);
>       |                 ^~~~~~~~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:35:17: note: ‘strftime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:37:17: error: ‘strftime’ was not declared in this scope
>    37 |                 strftime(abuf, DATETOOLS_BUFFER_SIZE, "%Y%m%d%H%M", ptm);
>       |                 ^~~~~~~~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:37:17: note: ‘strftime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:39:17: error: ‘strftime’ was not declared in this scope
>    39 |                 strftime(abuf, DATETOOLS_BUFFER_SIZE, "%Y", ptm);
>       |                 ^~~~~~~~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:39:17: note: ‘strftime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:41:17: error: ‘strftime’ was not declared in this scope
>    41 |                 strftime(abuf, DATETOOLS_BUFFER_SIZE, "%Y%m", ptm);
>       |                 ^~~~~~~~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:41:17: note: ‘strftime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:43:17: error: ‘strftime’ was not declared in this scope
>    43 |                 strftime(abuf, DATETOOLS_BUFFER_SIZE, "%Y%m%d", ptm);
>       |                 ^~~~~~~~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:43:17: note: ‘strftime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:45:17: error: ‘strftime’ was not declared in this scope
>    45 |                 strftime(abuf, DATETOOLS_BUFFER_SIZE, "%Y%m%d%H", ptm);
>       |                 ^~~~~~~~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:45:17: note: ‘strftime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp: In static member function ‘static tm* lucene::document::DateTools::stringToDate(const TCHAR*)’:
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:54:19: error: ‘gmtime’ was not declared in this scope
>    54 |         tm *ptm = gmtime(&secs);
>       |                   ^~~~~~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:54:19: note: ‘gmtime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp: In static member function ‘static int64_t lucene::document::DateTools::stringToTime(const TCHAR*)’:
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:59:6: error: aggregate ‘tm s_time’ has incomplete type and cannot be defined
>    59 |   tm s_time;
>       |      ^~~~~~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:163:14: error: ‘mktime’ was not declared in this scope
>   163 |   time_t t = mktime(&s_time);
>       |              ^~~~~~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:163:14: note: ‘mktime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp: In static member function ‘static int64_t lucene::document::DateTools::getDifferenceFromGMT()’:
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:177:5: error: ‘time’ was not declared in this scope
>   177 |     time( &secs );  // Current time in GMT
>       |     ^~~~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:177:5: note: ‘time’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:178:12: error: ‘localtime’ was not declared in this scope
>   178 |     tptr = localtime( &secs );
>       |            ^~~~~~~~~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:178:12: note: ‘localtime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:179:18: error: ‘mktime’ was not declared in this scope
>   179 |     local_secs = mktime( tptr );
>       |                  ^~~~~~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:179:18: note: ‘mktime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:180:12: error: ‘gmtime’ was not declared in this scope
>   180 |     tptr = gmtime( &secs );
>       |            ^~~~~~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:180:12: note: ‘gmtime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp: In static member function ‘static int64_t lucene::document::DateTools::timeMakeInclusive(int64_t)’:
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:188:15: error: ‘localtime’ was not declared in this scope
>   188 |     tm *ptm = localtime(&secs); // use localtime since mktime below will convert the time to GMT before returning
>       |               ^~~~~~~~~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:188:15: note: ‘localtime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:189:8: error: invalid use of incomplete type ‘struct tm’
>   189 |     ptm->tm_hour = 23;
>       |        ^~
> In file included from /usr/include/c++/12/cwchar:44,
>                  from /usr/include/c++/12/bits/postypes.h:40,
>                  from /usr/include/c++/12/bits/char_traits.h:39,
>                  from /usr/include/c++/12/string:40,
>                  from /<<PKGBUILDDIR>>/src/shared/CLucene/SharedHeader.h:62,
>                  from /<<PKGBUILDDIR>>/src/core/CLucene/StdHeader.h:20,
>                  from /<<PKGBUILDDIR>>/src/core/CLucene/_ApiHeader.h:15,
>                  from /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:7:
> /usr/include/wchar.h:83:8: note: forward declaration of ‘struct tm’
>    83 | struct tm;
>       |        ^~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:190:8: error: invalid use of incomplete type ‘struct tm’
>   190 |     ptm->tm_min = 59;
>       |        ^~
> /usr/include/wchar.h:83:8: note: forward declaration of ‘struct tm’
>    83 | struct tm;
>       |        ^~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:191:8: error: invalid use of incomplete type ‘struct tm’
>   191 |     ptm->tm_sec = 59;
>       |        ^~
> /usr/include/wchar.h:83:8: note: forward declaration of ‘struct tm’
>    83 | struct tm;
>       |        ^~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:193:16: error: ‘mktime’ was not declared in this scope
>   193 |     time_t t = mktime(ptm);
>       |                ^~~~~~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:193:16: note: ‘mktime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp: In static member function ‘static int64_t lucene::document::DateTools::getTime(short unsigned int, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, short unsigned int)’:
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:207:5: error: ‘time’ was not declared in this scope
>   207 |     time ( &rawtime );
>       |     ^~~~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:207:5: note: ‘time’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:208:14: error: ‘localtime’ was not declared in this scope
>   208 |     s_time = localtime ( &rawtime ); // use localtime, since mktime will take into account TZ differences
>       |              ^~~~~~~~~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:208:14: note: ‘localtime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:209:11: error: invalid use of incomplete type ‘struct tm’
>   209 |     s_time->tm_isdst = 0; // since we are using gmtime all around, make sure DST is off
>       |           ^~
> /usr/include/wchar.h:83:8: note: forward declaration of ‘struct tm’
>    83 | struct tm;
>       |        ^~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:211:11: error: invalid use of incomplete type ‘struct tm’
>   211 |     s_time->tm_year = year - 1900;
>       |           ^~
> /usr/include/wchar.h:83:8: note: forward declaration of ‘struct tm’
>    83 | struct tm;
>       |        ^~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:212:11: error: invalid use of incomplete type ‘struct tm’
>   212 |     s_time->tm_mon = month - 1;
>       |           ^~
> /usr/include/wchar.h:83:8: note: forward declaration of ‘struct tm’
>    83 | struct tm;
>       |        ^~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:213:11: error: invalid use of incomplete type ‘struct tm’
>   213 |     s_time->tm_mday = mday;
>       |           ^~
> /usr/include/wchar.h:83:8: note: forward declaration of ‘struct tm’
>    83 | struct tm;
>       |        ^~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:214:11: error: invalid use of incomplete type ‘struct tm’
>   214 |     s_time->tm_hour = hours;
>       |           ^~
> /usr/include/wchar.h:83:8: note: forward declaration of ‘struct tm’
>    83 | struct tm;
>       |        ^~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:215:11: error: invalid use of incomplete type ‘struct tm’
>   215 |     s_time->tm_min = minutes;
>       |           ^~
> /usr/include/wchar.h:83:8: note: forward declaration of ‘struct tm’
>    83 | struct tm;
>       |        ^~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:216:11: error: invalid use of incomplete type ‘struct tm’
>   216 |     s_time->tm_sec = seconds;
>       |           ^~
> /usr/include/wchar.h:83:8: note: forward declaration of ‘struct tm’
>    83 | struct tm;
>       |        ^~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:218:16: error: ‘mktime’ was not declared in this scope
>   218 |     time_t t = mktime(s_time);
>       |                ^~~~~~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:218:16: note: ‘mktime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp: In static member function ‘static TCHAR* lucene::document::DateTools::getISOFormat(int64_t)’:
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:228:15: error: ‘gmtime’ was not declared in this scope
>   228 |     tm *ptm = gmtime(&secs);
>       |               ^~~~~~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:228:15: note: ‘gmtime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:229:28: error: invalid use of incomplete type ‘struct tm’
>   229 |     return getISOFormat(ptm->tm_year + 1900, ptm->tm_mon + 1, ptm->tm_mday, ptm->tm_hour, ptm->tm_min,
>       |                            ^~
> /usr/include/wchar.h:83:8: note: forward declaration of ‘struct tm’
>    83 | struct tm;
>       |        ^~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:229:49: error: invalid use of incomplete type ‘struct tm’
>   229 |     return getISOFormat(ptm->tm_year + 1900, ptm->tm_mon + 1, ptm->tm_mday, ptm->tm_hour, ptm->tm_min,
>       |                                                 ^~
> /usr/include/wchar.h:83:8: note: forward declaration of ‘struct tm’
>    83 | struct tm;
>       |        ^~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:229:66: error: invalid use of incomplete type ‘struct tm’
>   229 |     return getISOFormat(ptm->tm_year + 1900, ptm->tm_mon + 1, ptm->tm_mday, ptm->tm_hour, ptm->tm_min,
>       |                                                                  ^~
> /usr/include/wchar.h:83:8: note: forward declaration of ‘struct tm’
>    83 | struct tm;
>       |        ^~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:229:80: error: invalid use of incomplete type ‘struct tm’
>   229 |     return getISOFormat(ptm->tm_year + 1900, ptm->tm_mon + 1, ptm->tm_mday, ptm->tm_hour, ptm->tm_min,
>       |                                                                                ^~
> /usr/include/wchar.h:83:8: note: forward declaration of ‘struct tm’
>    83 | struct tm;
>       |        ^~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:229:94: error: invalid use of incomplete type ‘struct tm’
>   229 |     return getISOFormat(ptm->tm_year + 1900, ptm->tm_mon + 1, ptm->tm_mday, ptm->tm_hour, ptm->tm_min,
>       |                                                                                              ^~
> /usr/include/wchar.h:83:8: note: forward declaration of ‘struct tm’
>    83 | struct tm;
>       |        ^~
> /<<PKGBUILDDIR>>/src/core/CLucene/document/DateTools.cpp:230:12: error: invalid use of incomplete type ‘struct tm’
>   230 |         ptm->tm_sec, ms);
>       |            ^~
> /usr/include/wchar.h:83:8: note: forward declaration of ‘struct tm’
>    83 | struct tm;
>       |        ^~
> make[3]: *** [src/core/CMakeFiles/clucene-core.dir/build.make:569: src/core/CMakeFiles/clucene-core.dir/CLucene/document/DateTools.o] Error 1


The full build log is available from:
http://qa-logs.debian.net/2022/07/28/clucene-core_2.3.3.4+dfsg-1_unstable.log

All bugs filed during this archive rebuild are listed at:
https://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=ftbfs-20220728;users=lucas@debian.org
or:
https://udd.debian.org/bugs/?release=na&merged=ign&fnewerval=7&flastmodval=7&fusertag=only&fusertagtag=ftbfs-20220728&fusertaguser=lucas@debian.org&allbugs=1&cseverity=1&ctags=1&caffected=1#results

A list of current common problems and possible solutions is available at
http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute!

If you reassign this bug to another package, please marking it as 'affects'-ing
this package. See https://www.debian.org/Bugs/server-control#affects

If you fail to reproduce this, please provide a build log and diff it with mine
so that we can identify if something relevant changed in the meantime.

Back to linux.debian.bugs.dist | Previous | Next | Find similar | Unroll thread


Thread

Bug#1016219: clucene-core: FTBFS: DateTools.cpp:26:19: error: ‘gmtime’ was not declared in this scope Lucas Nussbaum <lucas@debian.org> - 2022-07-29 18:50 +0200

csiph-web