|  |  
 
All MySQL programs compile cleanly for us with no warnings on
Solaris using gcc. On other systems, warnings may occur due to
differences in system include files. See  4.9  Remarques sur MIT-pthreads, for warnings
that may occur when using MIT-pthreads.  For other problems, check the list
below. 
The solution to many problems involves reconfiguring.  If you do need to
reconfigure, take note of the following:
 
 
If configureis run after it already has been run, it may use
information that was gathered during its previous invocation.  This
information is stored in `config.cache'.  Whenconfigurestarts
up, it looks for that file and reads its contents if it exists, on the
assumption that the information is still correct.  That assumption is invalid
when you reconfigure.
Each time you run configure, you must runmakeagain
to recompile.  However, you may want to remove old object files from previous
builds first, since they were compiled using different configuration options. 
To prevent old configuration information or object files from being used,
run these commands before rerunning configure: 
shell> rm config.cache
shell> make clean
 
Alternatively, you can run make distclean. 
The list below describes some of the problems compiling MySQL
that have been found to occur most often:
 
If you get errors when compiling `sql_yacc.cc' such as the ones shown
below, you have probably run out of memory or swap space:
Internal compiler error: program cc1plus got fatal signal 11
  or
Out of virtual memory
  or
Virtual memory exhausted
The problem is that gccrequires huge amounts of memory to compile
`sql_yacc.cc' with inline functions.  Try runningconfigurewith
the--with-low-memoryoption:
shell> ./configure --with-low-memory
This option causes -fno-inlineto be added to the compile line if you
are usinggccand-O0if you are using something else.  You
should try the--with-low-memoryoption even if you have so much
memory and swap space that you think you can't possibly have run out.  This
problem has been observed to occur even on systems with generous hardware
configurations, and the--with-low-memoryoption usually fixes it.
By default, configurepicksc++as the compiler name and
GNUc++links with-lg++.  If you are usinggcc,
that behavior can cause problems during configuration such as this:
configure: error: installation or configuration problem:
C++ compiler cannot create executables.
You might also observe problems during compilation related to g++,libg++orlibstdc++.
One cause of these problems is that you may not haveg++, or you may
haveg++but notlibg++orlibstdc++.  Take a look at
the `config.log' file.  It should contain the exact reason why your c++
compiler didn't work!  To work around these problems, you can usegccas your C++ compiler.  Try setting the environment variableCXXto"gcc -O3".  For example:
shell> CXX="gcc -O3" ./configure
This works because gcccompiles C++ sources as well asg++does, but does not link inlibg++orlibstdc++by default.
Another way to fix these problems, of course, is to installg++,libg++andlibstdc++.
If your compile fails with errors such as any of the following,
you must upgrade your version of maketo GNUmake:
making all in mit-pthreads
make: Fatal error in reader: Makefile, line 18:
Badly formed macro assignment
  or
make: file `Makefile' line 18: Must be a separator (:
  or
pthread.h: No such file or directory
Solaris and FreeBSD are known to have troublesome makeprograms.
GNUmakeversion 3.75 is known to work.
If you want to define flags to be used by your C or C++ compilers, do so by
adding the flags to the CFLAGSandCXXFLAGSenvironment
variables.  You can also specify the compiler names this way usingCCandCXX.  For example:
shell> CC=gcc
shell> CFLAGS=-O6
shell> CXX=gcc
shell> CXXFLAGS=-O6
shell> export CC CFLAGS CXX CXXFLAGS
See  4.14  TcX, for a list of flag definitions that have been found
to be useful on various systems.
If you get an error message like this,
you need to upgrade your gcccompiler:
client/libmysql.c:273: parse error before `__attribute__'
 gcc2.8.1 is known to work, but we recommend usingegcs1.0.3a or newer instead.
If you get errors such as those shown below when compiling mysqld,configuredidn't correctly detect the type of the last argument toaccept(),getsockname()orgetpeername():
cxx: Error: mysqld.cc, line 645: In this statement, the referenced
     type of the pointer value "&length" is "unsigned long", which
     is not compatible with "int".
new_sock = accept(sock, (struct sockaddr *)&cAddr, &length);
To fix this, edit the `config.h' file (which is generated byconfigure).  Look for these lines:
/* Define as the base type of the last arg to accept */
#define SOCKET_SIZE_TYPE XXX
Change XXXtosize_torint, depending on your
operating system.  (Note that you will have to do this each time you runconfigure, sinceconfigureregenerates `config.h'.)
The `sql_yacc.cc' file is generated from `sql_yacc.yy'.  Normally
the build process doesn't need to create `sql_yacc.cc', because
MySQL comes with an already-generated copy.  However, if you do need
to recreate it, you might encounter this error:
"sql_yacc.yy", line xxx fatal: default action causes potential...
This is a sign that your version of yaccis deficient.
You probably need to installbison(the GNU version ofyacc)
and use that instead.
If you need to debug mysqldor a MySQL client, runconfigurewith the--with-debugoption, then recompile and
link your clients with the new client library.
  G.2  Debugguer un client MySQL. |