[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: more mingw C++ link failures
From: |
Bruno Haible |
Subject: |
Re: more mingw C++ link failures |
Date: |
Sat, 1 May 2010 10:47:19 +0200 |
User-agent: |
KMail/1.9.9 |
Hi Eric,
Eric Blake wrote:
> I'm getting the following failure while testing my open_memstream changes:
>
> $ ./gnulib-tool --with-tests --create-testdir --dir=testdir-mingw \
> open_memstream
> $ cd testdir-mingw
> $ ./configure --host=i686-pc-mingw32 --build=i686-pc-cygwin \
> CC='gcc-3 -mno-cygwin' CXX='g++-3 -mno-cygwin
> ...
> $ make check
I did this, and I don't reproduce:
$ ./gnulib-tool --create-testdir ... --with-tests \
extensions fclose fflush ftello full-read stdio strdup-posix tmpfile unistd
...
$ ./configure --host=i586-pc-mingw32 --prefix=/usr/local/mingw \
CC="gcc-3 -mno-cygwin" \
CXX="g++-3 -mno-cygwin" \
CPPFLAGS="-I/usr/local/mingw/include -Wall" \
LDFLAGS="-L/usr/local/mingw/lib"
> g++-3 -mno-cygwin -DHAVE_CONFIG_H -I. -DGNULIB_STRICT_CHECKING=1 -I. -I.
> -I.. -I./.. -I../gllib -I./../gllib -MT test-time-c++2.o -MD -MP -MF
> .deps/test-time-c++2.Tpo -c -o test-time-c++2.o test-time-c++2.cc
> In file included from test-time-c++2.cc:20:
> /usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/ctime:76: error:
> `::gmtime' has not been declared
> /usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/ctime:77: error:
> `::localtime' has not been declared
>
> Sounds like we need to be careful with whether gmtime and localtime have
> been declared while building the replacement <time.h>
How come they are not defined in /usr/include/mingw/time.h for you?
For me, in Cygwin 1.5.25:
- /usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/ctime line 51 contains
#include <time.h>
- The generated gllib/time.h does a #include_next <time.h> in all cases.
- /usr/include/mingw/time.h lines 101..102 contains these declarations:
_CRTIMP struct tm* __cdecl __MINGW_NOTHROW gmtime (const time_t*);
_CRTIMP struct tm* __cdecl __MINGW_NOTHROW localtime (const time_t*);
They are not enclosed in a #if.
But in Cygwin 1.7 /usr/include/mingw/time.h:
#if __MSVCRT_VERSION__ < 0x0800
_CRTIMP char* __cdecl __MINGW_NOTHROW ctime (const time_t*);
_CRTIMP struct tm* __cdecl __MINGW_NOTHROW gmtime (const time_t*);
_CRTIMP struct tm* __cdecl __MINGW_NOTHROW localtime (const time_t*);
#endif
Why have they disabled these declarations conditionally? I see no indication
in [1][2][3].
Bruno
[1] http://msdn.microsoft.com/en-us/library/aa246427(VS.60).aspx
[2] http://msdn.microsoft.com/en-us/library/0z9czt0w.aspx
[3] http://msdn.microsoft.com/en-us/library/3stkd9be(VS.80).aspx
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: more mingw C++ link failures,
Bruno Haible <=