This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: gcc-3.3.1 build problem MAXHOSTNAMELEN undeclared
- From: "Becky Sander" <rknigh at sandia dot gov>
- To: gcc-help at gcc dot gnu dot org
- Date: Fri, 10 Oct 2003 06:13:27 -0600
- Subject: Re: gcc-3.3.1 build problem MAXHOSTNAMELEN undeclared
- References: <3F865665.3030307@kegel.com>
As Dan points out, grep didn't show the whole
story. I still don't understand the code well
enough to explain it, but I did get gcc to build
by just inserting the
#define MAXHOSTNAMELEN 256
line in the natInetAddress.cc file. Thanks for
your consideration,
Bec
Dan Kegel wrote:
>
> Becky Sander wrote:
> > I'm having problems building gcc3.3.1 on solaris 2.7. ...
> > ../../../gcc-3.3.1/libjava/java/net/natInetAddress.cc:338:error: `MAXHOSTNAMELEN' undeclared (first use this function)
> > ...
> > # grep MAXHOST /usr/include/netdb.h
> > #define MAXHOSTNAMELEN 256
> >
> > I've added /usr/include with CPPFLAGS environment
> > variable, but the build still crashes here. And,
> > I can't seem to locate where buffer is defined,
> > either. I'm completely stuck. Any suggestions are
> > greatly appreciated!
>
> Grep doesn't tell the whole story. Look at the previous ten lines:
>
> #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
> #define NO_ADDRESS NO_DATA /* no address, look for MX record */
>
> /* BIND */
> #define NETDB_INTERNAL -1 /* see errno */
> #define NETDB_SUCCESS 0 /* no problem */
> /* End BIND */
>
> #define MAXHOSTNAMELEN 256
>
> Maybe gcc doesn't define __EXTENSIONS__. You could try setting
> CXXFLAGS="-g -O2 -D__EXTENSIONS__" when running gcc's configure;
> not sure if that's how to jam that define in there, but it sounds
> good to me.
> - Dan
>
> --
> Dan Kegel
> http://www.kegel.com
> http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045
--
Becky Sander CSU Special Projects
rknigh@sandia.gov 505.844.1164