Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs Date: Wed, 11 Jun 2003 10:55:09 -0400 (EDT) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: Lionel Zhou cc: cygwin AT cygwin DOT com Subject: Re: w32api/windef.h In-Reply-To: <20030611061645.32495.qmail@verizonmail.com> Message-ID: Importance: Normal MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 11 Jun 2003, Lionel Zhou wrote: > ----- Original Message ----- > From: Igor Pechtchanski > Date: Mon, 9 Jun 2003 09:17:21 -0400 (EDT) > To: Lionel Zhou > Subject: Re: w32api/windef.h > > > On Sun, 8 Jun 2003, Lionel Zhou wrote: > > > > > ----- Original Message ----- > > > From: Christopher Faylor > > > Date: Sun, 8 Jun 2003 11:21:43 -0400 > > > To: cygwin AT cygwin DOT com > > > Subject: Re: w32api/windef.h > > > > > > > On Sun, Jun 08, 2003 at 07:19:30AM -0500, Lionel Zhou wrote: > > > > >In file included from utils.c:4: > > > > >/usr/include/w32api/windef.h:273: parse error before "void" > > > > > > > > > >has anyone successfully used the windef.h header and could you tell me > > > > >how to compile program like this? > > > > > > > > > >my windef.h is attached here. > > > > > > > > #include > > > > > > > > Not windef.h. That might help. > > > > > > > > cgf > > > > > > thank you christopher and elfyn, > > > > > > i tried your advice but it doesn't solve the problem. > > > > > > grep windef /usr/local/w32api/windows.h > > > #include > > > > > > so that windows.h is just a superset of header definitions which > > > includes windef.h > > > > > > program compile with the same error: > > > > > > In file included from windows.h:48: > > > from utils.c:4: > > > /usr/include/w32api/windef.h:273: parse error before "void" > > > > > > grep void /usr/include/w32api/windef.h > > > #define NULL ((void*)0) > > > typedef CONST void *PCVOID,*LPCVOID; > > > typedef void *HGDIOBJ; > > > > > > i also tried the -mwin32 compile flag which lead to more errors because > > > of conflicting definitions. the program is wrote for linux and is being > > > ported to windows. this is about the only function that uses win32 api > > > in this program. > > > > > > lionel > > > > Lionel, > > > > Check the part of your program *before* the '#include "windows.h"' (either > > the program itself, or the header files). This could be a common C > > problem with a missing semicolon after a struct definition (e.g., > > something like > > > > struct AAA { > > int blah; > > } > > > > void main(void) { ... } > > > > will give you a similar error). > > Igor > > thank you prof. igor, > > this is not the problem here. i have made a test program like this. > > ----utils.c---- > #include "ffss.h" > #include "utils.h" > #include > > char *FFSS_GetOS(void) > { > return FFSS_SERVER_OS; > } > ----end here---- > > this short program won't compile, no win32 api is used. > > In file included from utils.c:4: > /usr/include/w32api/windef.h:273: parse error before "void" > > how ever, if i change the order of the headers, like this: > > ----utils2.c---- > #include > #include "ffss.h" > #include "utils.h" > > char *FFSS_GetOS(void) > { > return FFSS_SERVER_OS; > } > ----end here---- > > this still don't compile and a lot of errors crop out. > > > In file included from ffss.h:58, > from utils.c:3: > /usr/include/bzlib.h:163: two or more data types in declaration of `type name' > /usr/include/bzlib.h:186: two or more data types in declaration of `type name' > /usr/include/bzlib.h:262: two or more data types in declaration of `type name' > In file included from utils.c:3: > ffss.h:64:1: warning: "LOG_INFO" redefined > In file included from /usr/include/syslog.h:14, > from /usr/local/include/skyutils.h:256, > from ffss.h:49, > from utils.c:3: > /usr/include/sys/syslog.h:21:1: warning: this is the location of the previous definition > In file included from utils.c:3: > ffss.h:65:1: warning: "LOG_WARNING" redefined > In file included from /usr/include/syslog.h:14, > from /usr/local/include/skyutils.h:256, > from ffss.h:49, > from utils.c:3: > /usr/include/sys/syslog.h:19:1: warning: this is the location of the previous definition > In file included from utils.c:3: > ffss.h:66:1: warning: "LOG_ERR" redefined > In file included from /usr/include/syslog.h:14, > from /usr/local/include/skyutils.h:256, > from ffss.h:49, > from utils.c:3: > /usr/include/sys/syslog.h:18:1: warning: this is the location of the previous definition > In file included from /usr/include/sys/socket.h:15, > from /usr/include/cygwin/if.h:19, > from /usr/include/net/if.h:14, > from utils.h:6, > from utils.c:4: > /usr/include/cygwin/socket.h:18: redefinition of `struct sockaddr' > In file included from /usr/include/sys/socket.h:15, > from /usr/include/cygwin/if.h:19, > from /usr/include/net/if.h:14, > from utils.h:6, > from utils.c:4: > /usr/include/cygwin/socket.h:28: redefinition of `struct linger' > In file included from /usr/include/cygwin/if.h:19, > from /usr/include/net/if.h:14, > from utils.h:6, > from utils.c:4: > /usr/include/sys/socket.h:29: conflicting types for `accept' > /usr/include/w32api/winsock2.h:515: previous declaration of `accept' > /usr/include/sys/socket.h:30: conflicting types for `bind' > /usr/include/w32api/winsock2.h:516: previous declaration of `bind' > /usr/include/sys/socket.h:31: conflicting types for `connect' > /usr/include/w32api/winsock2.h:518: previous declaration of `connect' > /usr/include/sys/socket.h:32: conflicting types for `getpeername' > /usr/include/w32api/winsock2.h:520: previous declaration of `getpeername' > /usr/include/sys/socket.h:33: conflicting types for `getsockname' > /usr/include/w32api/winsock2.h:521: previous declaration of `getsockname' > /usr/include/sys/socket.h:34: conflicting types for `listen' > /usr/include/w32api/winsock2.h:525: previous declaration of `listen' > /usr/include/sys/socket.h:35: conflicting types for `recv' > /usr/include/w32api/winsock2.h:526: previous declaration of `recv' > /usr/include/sys/socket.h:37: conflicting types for `recvfrom' > /usr/include/w32api/winsock2.h:527: previous declaration of `recvfrom' > /usr/include/sys/socket.h:39: conflicting types for `send' > /usr/include/w32api/winsock2.h:528: previous declaration of `send' > /usr/include/sys/socket.h:42: conflicting types for `sendto' > /usr/include/w32api/winsock2.h:529: previous declaration of `sendto' > /usr/include/sys/socket.h:43: conflicting types for `setsockopt' > /usr/include/w32api/winsock2.h:530: previous declaration of `setsockopt' > /usr/include/sys/socket.h:44: conflicting types for `getsockopt' > /usr/include/w32api/winsock2.h:522: previous declaration of `getsockopt' > /usr/include/sys/socket.h:45: conflicting types for `shutdown' > /usr/include/w32api/winsock2.h:531: previous declaration of `shutdown' > /usr/include/sys/socket.h:46: conflicting types for `socket' > /usr/include/w32api/winsock2.h:532: previous declaration of `socket' > /usr/include/sys/socket.h:49: conflicting types for `getservbyname' > /usr/include/w32api/winsock2.h:536: previous declaration of `getservbyname' > > i need to check the iso standard of c to see if the order of included > headers is consequencial for compilers. this caught me in surprise > > lionel Lionel, First off, don't bother with the standard: the order of the headers most definitely *does* matter. Secondly, you didn't read my reply carefully. Quoting (with emphasis): > > Check the part of your program *before* the '#include "windows.h"' > > (either the program itself, or the header files). ^^^^^^^^^^^^^^^^^^^ It looks like there's a problem with your header file, ffss.h. My guess would be a missing semicolon, but it could be something else (like a double-include, for example). Can't really say for sure without seeing the header itself. Igor P.S. (minor) I'm not a professor... ;-) -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D. '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "I have since come to realize that being between your mentor and his route to the bathroom is a major career booster." -- Patrick Naughton -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/