delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/08/01/12:30:56

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <A9DD5EB41ADBD3119044009027CA8A25388C9C@ex2beimcombx02>
From: "CLYNES Darius (SCIC)" <Darius DOT Clynes AT cec DOT eu DOT int>
To: cygwin AT sourceware DOT cygnus DOT com
Subject: g++ error: ANSI C++ forbids declaration with not type
Date: Tue, 1 Aug 2000 18:29:22 +0200
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)

Hi,

I have been compiling without problems using the gcc compiler against
standard Xlib files
like X11/Xlib.h. Now I have several  c++ modules which also include X11
calls and when
I compile using the g++ compiler I get the following error:

 ANSI C++ forbids declaration `XSetTransientForHint' with no type

for about 100 different functions.

the function is declare in the Xlib.h without a type like this without a
type. 

extern XSetTransientForHint(
#if NeedFunctionPrototypes
    Display*            /* display */,
    Window              /* w */,
    Window              /* prop_window */
#endif
);

(NeedFunctionPrototypes is defined).

The C compiler and gcc
defaults to int for non-declared types, but I can't seem to get g++ to
default to int.

Does anybody know a work around. On Unix, the same code compiles under cxx
without
any problem or special switches flags ect. I have tried -traditional, and
even tried putting
extern "C" {
X11/Xlib.h
}

and tried redefining extern to extern "C"

but none of these seem to work.

I don't want to have to edit the distributed X11 files, just to get by the
g++ compiler.

Thanks in advance

Darius







 
  ANSI C++ forbids declaration

Darius Clynes 
Software Engineer
European Commission
Rue De Mot 24
Brussels, 1040 
Belgium

Office tel: +32 2   2962441
       fax: +32 2   2966025
Cell phone: +32 476 218850



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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