delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/01/09/07:49:48

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <3C3C3C4C.4080105@syntrex.com>
Date: Wed, 09 Jan 2002 13:49:16 +0100
From: Pavel Tsekov <ptsekov AT syntrex DOT com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20011126 Netscape6/6.2.1
X-Accept-Language: en-us
MIME-Version: 1.0
To: Jean le Roux <jean AT infosat DOT net>
CC: cygwin AT cygwin DOT com
Subject: Re: w32api header problems
References: <20020109115348 DOT A14411 AT infosat DOT net> <67136319166 DOT 20020109130747 AT logos-m DOT ru> <20020109133833 DOT A20443 AT infosat DOT net> <3C3C2C12 DOT 7090102 AT syntrex DOT com> <20020109142543 DOT C20549 AT infosat DOT net>


Jean le Roux wrote:

> On Wed, Jan 09, 2002 at 12:40:02PM +0100, Pavel Tsekov wrote:
> 
>>Jean le Roux wrote:
>>
>>
>>>On Wed, Jan 09, 2002 at 01:07:47PM +0300, egor duda wrote:
>>>
>>>
>>>>Hi!
>>>>
>>>>Wednesday, 09 January, 2002 Jean le Roux jean AT infosat DOT net wrote:
>>>>
>>>>JlR> I need to include /usr/include/w32api/winbase.h in order to use the
>>>>JlR> GetVolumeInformation(...) system call under windows.
>>>>
>>>>JlR> However, as i metioned in an earlier mail, DWORD seems to not be
>>>>JlR> defined. I tracked DWORD's definition down to windef.h.. but it seems
>>>>JlR> the whole include chain is a bit funny.. there are lots of
>>>>JlR> inter-dependencies which are not satisfied. 
>>>>
>>>>JlR> Does anyone have any words of wisdom to make life a little easier, or
>>>>JlR> do I simply have to test for, and include, all the headers in w32api ?
>>>>
>>>>you ought to
>>>>
>>>>#include <windows.h>
>>>>
>>>I've done this but <windows.h> seems to leave my code in a tangle :)
>>>I suddenly have parse errors in my own header files, on normal
>>>function declerations. I can only deduce that windows.h is leaving an
>>>open ifdef or has unterminated strings or something silly.
>>>
>>>Anybody encounter this before? Any suggestions ?
>>>I can put the compiler output online if someone wants to take a look,
>>>and ofcourse some code snippets. 
>>>
>>
>>It would be helpful :)
>>
> 
> Here it is: first the relevant snip from my header file (common.h), and then the
> compilers pain.
> 
> [common.h]
> ...
> //this is where i include the header that make life hard :)
> 
> #ifdef HAVE_WINDOWS_H
> #include <windows.h>
> #endif
> 
> ...
> 
> //this is where the errors occur. 
> /*other*/
> int 	 max(const int value_a, const int value_b); //line 283
> int 	 min(const int value_a, const int value_b); //line 284


To fix the min and max, define the following before including windows.h:
#define NOMINMAX


> string itoa(const int value, const short fix=0); //line 285
> 


Have you included <string> ?


> ...
> 
> [compiler output]
>  cd . \
>   && CONFIG_FILES= CONFIG_HEADERS=config.h \
>      /bin/sh ./config.status
> creating config.h
> config.h is unchanged
> make  all-recursive
> make[1]: Entering directory `/cygdrive/e/projects/multicast/pmfp'
> Making all in libsrc
> make[2]: Entering directory `/cygdrive/e/projects/multicast/pmfp/libsrc'
> /bin/sh ../libtool --mode=compile c++ -DHAVE_CONFIG_H -I. -I. -I..     -g -O2 -c common.cc
> rm -f .libs/common.lo
> c++ -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wp,-MD,.deps/common.pp -c common.cc  -DPIC -o .libs/common.lo
> In file included from common.cc:5:
> common.h:284: parse error before `const'
> common.h:285: parse error before `const'
> common.cc:524: parse error before `const'
> common.cc:529: parse error before `const'
> make[2]: *** [common.lo] Error 1
> make[2]: Leaving directory `/cygdrive/e/projects/multicast/pmfp/libsrc'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/cygdrive/e/projects/multicast/pmfp'
> make: *** [all-recursive-am] Error 2



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019