This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

Re: File type assumptions?


> From: "Pyle, Mike" <mike.pyle@centraxcorp.com>
> To: egcs@egcs.cygnus.com
> Date: Wed, 16 Jun 1999 14:35:03 -0700

> We [ ... ] are seeing some interesting behavior in the file type
> assumptions being made by egcs.  [ ... ]  Our problem is that the
> compiler is attempting to compile C++ files as C files and appears
> to be doing this based on the directory the files are in.

> If we create a directory underneath /usr/include and put header
> files in there that contain templates, we get an error complaining
> about trying to create a template using C linkage. If we put those
> same files in a directory somewhere else (say /usr/local/include/foo
> or even /usr/foo) everything works fine. Somehow, it looks like our
> installation got squirreled up but we are not sure what's wrong. Is
> there some sort of configuration parameter that controls this kind
> of thing?

It is working as designed.  You are not Sun, only sun is to put files
in /usr/include.  The files they put in there are C language files.
If you really want to put C++ files in there, you will need to put
extern "C++" on stuff.

If you put your files someplace else, it will work.

You can complain to Sun and ask them to provide C++ ready headerfiles
in /usr/include if you don't like this.


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