help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Installing GCC on Solaris 2.6


From: Amy Roberts
Subject: Installing GCC on Solaris 2.6
Date: Thu, 16 Aug 2001 11:56:43 -0700 (PDT)

I tried to build gcc on my company's Solaris 2.6 machine. It seems like the
code is incompatible with the Sun compiler. The result is shown below. The
same result was obtained no matter what version of gcc was used. What is odd
is that when I run the configure script it says that it is indeed
configuring for host Solaris 2.6.



make[1]: Entering directory `/gcc-2.95/libiberty'
test x"no" != xyes || \
  cc -c -DHAVE_CONFIG_H -g -I. -I./../include   argv.c -o pic/argv.o
cc -c -DHAVE_CONFIG_H -g -I. -I./../include  argv.c
"argv.c", line 97: Error: argv is not defined.
"argv.c", line 103: Warning: The variable argv has not yet been
assigned a value.
"argv.c", line 116: Error: Cannot assign void* to char*.
"argv.c", line 122: Error: The function "strcpy" must have a prototype.


And the compiler error occurs on this segment in argv.c with line 97 being
the line that contains the fuction name: dupargv (argv)
I do know that my compiler does not support this declaration style in
general.


char **
dupargv (argv)
     char **argv;
{
  int argc;
  char **copy;

  if (argv == NULL)
    return NULL;

  /* the vector */
  for (argc = 0; argv[argc] != NULL; argc++);
  copy = (char **) malloc ((argc + 1) * sizeof (char *));
  if (copy == NULL)
    return NULL;

  /* the strings */
  for (argc = 0; argv[argc] != NULL; argc++)
    {
      int len = strlen (argv[argc]);
      copy[argc] = malloc (sizeof (char *) * (len + 1));
      if (copy[argc] == NULL)
        {
          freeargv (copy);
          return NULL;
        }
      strcpy (copy[argc], argv[argc]);
    }
  copy[argc] = NULL;
  return copy;
}

What do I need to do in order to install gcc?





_______________________________________________________
http://inbox.excite.com





reply via email to

[Prev in Thread] Current Thread [Next in Thread]