This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

g++ error: ANSI C++ forbids declaration with not type


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@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]