There have been several people reporting difficulty getting the MySQLGui program to compile with Fl_Editor. This page details the exact steps to compile MySQLGui, including links to all the pieces you will need.
The most recent release of mysqlgui (1.6x) requires a slightly different build process than that listed here, including the addition of another library (flvw, available from http://flvw.sourceforge.net). These build instructions will be updated soon to reflect the new changes. In the meantime, these processes can be used exactly to build from the packages downloadable from this page, or as a general guideline for building the later packages.
The components
It is assumed that already have mysql installed. If you don't please visit their web site and do so before anything else. Other than that, you will need the following things (Note: to use the download links, you may need to shift-click the links to download, particularly with Netscape).:
The process
Now that you have all the components you need, build them in the following order using the following steps. In the illustrations below, "$" indicates a shell prompt. (Note: commands shown are for bash on RedHat Linux 6.1. For other shells or platforms, change as appropriate, but the essential steps are still the same.)
$ tar -zxv <fl_editor-0.3-2.tgz $ bunzip2 --keep -c <fltk-1.0.7-source.tar.bz2 | tar -xv $ tar -zxv <mysqlgui-1.4.tar.gz $ tar -zxv <mysqlplusplus-1.5.tar.gz
Build the toolkits
$ cd fltk-1.0.7 $ ./configure $ make $ make install # may need to be root to do this $ cd ../mysql++-1.5 $ ./configure $ make $ make install # may need to be root to do this
Build the editor widgets
The editor widgets do not yet include an autoconfigure script, so for the moment you will need to edit the Makefile and change things to match your system. All the variables you may need to change are near the top of the file. Pay particular attention to the following two lines:
LINKGL = -lGL #LINKGL =
If you have OpenGL or Mesa installed on your system, leave them as-is. If you don't have either of those packages, or don't know what they are, then change those two lines to read as follows:
#LINKGL = -lGL LINKGL =
If you have Mesa installed, you may need to just leave the lines as they were, but change the "-lGL" to "-lMesaGL". You can now build the editor using the following commands (from the top fl_editor directory):
$ make $ make install # may need to be root to do this
Note that users of other compilers or platforms may need to make additional changes to the makefile, including the CC and CXX variables, and possibly removing the "ranlib" command if your system does not require or support it. In the future, this will be handled by an autoconfigure script. Sorry for the inconvenience in the meantime.
Build MySQLGui
You will probably need to edit the Makefile for this as well. If you're following these instructions along, you'll need to change the line that reads:
INCLUDE1 = -I. -I../mysql++-1.2/sqlplusint -I/usr/local/include/mysql
So that it reads:
INCLUDE1 = -I. -I../mysql++-1.5/sqlplusint -I/usr/local/include/mysql
On my system, I also had to change the include and library path for mysql, so check your configuration. I also had to add "-lGL" to the "LIBS =" line, since my FLTK is a shared library which links against the GL libraries. This may not be necessary on your system (see the common problems list below).
Depending on your platform, you may also need to change a couple of the source files. In particular, the Fl_MyTile.cc file contains several calls to sizes() and shows them returning an "int *" when they return a "short *". So just change those lines to reflect that. (Lines, 55, 77, 110, 174, and 175 needed this change -- you can do it yourself, or you can use this patch).
Once you have the Makefile changed, you should be able to build MySQLGui by simply typing "make" in the top mysqlgui directory. This will produce a binary file called "guiclient" that you can then copy to someplace on your path.
Common Problems
The most common problems that have been reported are the following:
Error building Fl_Editor - missing GL library
If you receive an error linking the Fl_Editor that says there is no GL library, you probably just need to change the two lines in the Makefile that control whether or not it links GL. The only reason this is an issue is because of the GL support in FLTK -- if you build FLTK as a shared library, it needs to be able to find the GL library. If you build FLTK as a static library, then you should not get this error. See above for details on setting up the Makefiles.Error linking MySQLGui - Missing EditorEngine::LoadSQL
This is an extension to the Fl_Editor which was added by the author of MySQLGui, and is included with the MySQLGui client installation. Check your MySQLGui directory to ensure that you have a file called "single.cc". That file should contain the above function, Some earlier packages of MySQLGui did not include it, but 1.4 does. See the link above in the "required components" list -- that package has been verified to include the necessary files.Note: If you are using the Fl_Editor archive from the MySQL page, then you may get this error while building the Fl_Editor package when it tries to link the demos. You have two choices -- either ignore it and do the "make install" on the editor libraries, or add the "single.cc" file from the MySQLGui distribution to the list of files linked to create the demos. However, the simplest thing to do is just download the updated packages listed above, and you should not get this error at all.
File Creation Errors during build or install
Make sure you have permission to write to the directories you are trying to use. In particular, when doing a "make install", you probably will need root permissions.