List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:September 25 1999 5:30am
Subject:Re: mysql-3.22.26a compile problems
View as plain text  
>>>>> "Tim" == Tim Sailer <tps@stripped> writes:

Tim> On Thu, Sep 23, 1999 at 11:57:37PM +0300, Michael Widenius wrote:
>> Hi!
>> 
>> The problem is that /usr/include/term.h  is not C++ safe.
>> 
>> On the other hand, I have compiled MySQL with SunPRO 4.2, so it's
>> possible to get this to work.
>> 
>> One know problem is that configure doesn't detect curses.h because of
>> another bug in the widec.h files.
>> 
>> Fix:
>> 
>> Add HAVE_CURSES_H in config.h and recompile.

Tim> OK, I did that, and now have a different error:

Tim> creating libmysqlclient.la
Tim> (cd .libs && rm -f libmysqlclient.la && ln -s ../libmysqlclient.la
> libmysqlclien
Tim> t.la)
Tim> CC -DUNDEF_THREADS_HACK -I./../include -I../include                             
Tim> -I./.. -I.. -I..    -O   -DDBUG_OFF -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -
Tim> c mysql.cc
Tim> "/usr/include/widec.h", line 42: Warning (Anachronism): Attempt to redefine getw
Tim> c without using #undef.
Tim> "/usr/include/widec.h", line 42: Note: Type "CC -migration" for more on anachron
Tim> isms.
Tim> "/usr/include/widec.h", line 43: Warning (Anachronism): Attempt to redefine putw
Tim> c without using #undef.
Tim> "/usr/include/widec.h", line 44: Warning (Anachronism): Attempt to redefine getw
Tim> char without using #undef.
Tim> "/usr/include/widec.h", line 45: Warning (Anachronism): Attempt to redefine putw
Tim> char without using #undef.
Tim> "sql_string.h", line 150: Error: Different types for "?:" (char and void).
Tim> 1 Error(s) and 4 Warning(s) detected.
Tim> *** Error code 1
Tim> make: Fatal error: Command failed for target `mysql.o'
Tim> Current working directory /scratch1/mysql-3.22.26a/client
Tim> *** Error code 1
Tim> make: Fatal error: Command failed for target `all-recursive'
Tim> Current working directory /scratch1/mysql-3.22.26a
Tim> *** Error code 1
Tim> make: Fatal error: Command failed for target `all-recursive-am'


Hi!

The problem with widec.h is a known error in the include file that Sun 
introduced in Solaris 7.

From the MySQL manual:

------
You can normally use a Solaris 2.6 binary on Solaris 2.7.  Most of the
Solaris 2.6 issues also apply for Solaris 2.7.

Solaris 2.7 has some bugs in the include files. You may see the
following error when you use `gcc':

     /usr/include/widec.h:42: warning: `getwc' redefined
     /usr/include/wchar.h:326: warning: this is the location of the previous
     definition

If this occurs, you can do the following to fix the problem:

Copy `/usr/include/widec.h' to `.../lib/gcc-lib/os/gcc-version/include'
and change line 41 from:

     #if     !defined(lint) && !defined(__lint)
     
     to
     
     #if     !defined(lint) && !defined(__lint) && !defined(getwc)

Alternatively, you can edit `/usr/include/widec.h' directly.  Either
way, after you make the fix, you should remove `config.cache' and run
`configure' again!

If you get errors like this when you run `make', it's because
`configure' didn't detect the `curses.h' file (probably because of the
error in `/usr/include/widec.h':

     In file included from mysql.cc:50:
     /usr/include/term.h:1060: syntax error before `,'
     /usr/include/term.h:1081: syntax error before `;'

The solution to this is to do one of the following steps:

   * Edit `/usr/include/widec.h' as indicted above and rerun configure

   * Remove the `#define HAVE_TERM' line from `config.h' file and run
     `make' again.

   * Configure with `CFLAGS=-DHAVE_CURSES CXXFLAGS=-DCURSES ./configure'
--------

The problem with string.h is a harder one.  The C++ compiler gives an
error at the following row:

  inline bool append(char chr)
  {
    if (str_length < Alloced_length)
    {
      Ptr[str_length++]=chr;
    }
    else
    {
      if (realloc(str_length+1))
	return 1;
      Ptr[str_length++]=chr;
    }				/* <- here */
    return 0;
  }

Which is not that helpful as the error comes from some other place.

This seams to be a bug in the newest Sun compiler as this works with
gcc and Sun Pro 4.2 :(

Anyhow, you can probable fix the above by removing the 'inline'
definition above (if this doesn't help, you will at least get a better 
error message).

Regards,
Monty
Thread
mysql-3.22.26a compile problemsTim Sailer23 Sep
  • Re: mysql-3.22.26a compile problemssasha23 Sep
    • Re: mysql-3.22.26a compile problemsTim Sailer23 Sep
  • mysql-3.22.26a compile problemsMichael Widenius24 Sep
    • Re: mysql-3.22.26a compile problemsTim Sailer24 Sep
      • Re: mysql-3.22.26a compile problemsMichael Widenius25 Sep