cURL / Mailing Lists / curl-library / Single Mail

curl-library

Error compiling with GCC 4.2.1 under MinGW

From: Duncan McQueen <dwmcqueen_at_gmail.com>
Date: Mon, 6 Aug 2007 20:24:52 -0600

I am using GCC 4.2.1 from
http://www.tdragon.net/recentgcc/ with the latest win32api and
ming-runtime. In compiling curl, I get the following error:

In file included from C:/MinGW-4.2.1/include/stdio.h:407,
                from C:\Projects\Third-Party\curl-7.16.4\lib\/setup.h:157,
                from C:\Projects\Third-Party\curl-7.16.4\lib\connect.c:24:
C:/MinGW-4.2.1/include/sys/types.h:104: error: two or more data types
in declaration specifiers
C:/MinGW-4.2.1/include/sys/types.h:104: warning: useless type name in
empty declaration

The offending code in types.h is :

#ifndef _NO_OLDNAMES
typedef _ssize_t ssize_t;
#endif
#endif /* Not _SSIZE_T_ */

I noticed that, included earlier is config-win32.h header file and it
defines ssize_t as follows:

#if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || defined(__POCC__)
#elif defined(_WIN64)
#define ssize_t __int64
#else
#define ssize_t int
#endif

This seems to throw a compilation error under 4.2.1 but not under the
release GCC 3.4.5.

What I am not sure of is whether it should be fixed....

Thanks,

Duncan McQueen
Received on 2007-08-07