Getting mysqlcc to build with newer gcc compilers and mysql headers

I used to use MySQL Control Center (’mysqlcc’) quite a lot until a few years ago, when I switched to phpMyAdmin.
The biggest advantage of phpMyAdmin is that it is actively maintained, while mysqlcc has not seen updates for almost three years.
mysqlcc’s interface also had a bit of an “old-fashioned” look, as it is still based on the Qt3 library (known from KDE3).

Anyway, these days I took a second look at it, because of a question about building it on Slackware 13.1 on the SlackBuilds mailing list.
My first reaction was like “Hey, try something more modern”, but on second thoughts I decided to give it a try and examine the source code and the build-time error messages from gcc.

The error messages

Without any modification, gcc throws several messages at you like this:src/main.cpp:93: error: 'gptr' was not declared in this scope

So I took a look at main.cpp and noticed that the lines causing the error message are part of a structure of ‘my_option’ lines:

Care to take a stab at getting mysqlcc to work with Mysql 5.5, 1 year later?

Missing symbol errors for functions defined in /usr/include/mysql/my_getopt.h that don’t seem to be in the .so. I commented out all these functions in main.cpp (they just check cmd line args, which I don’t use) but the resulting binary immediately segfaults in /usr/lib/mysql/libmysqlclient.so.18. Perhaps too much changed in the API? Or maybe there is a quick fix?

I did some investigation and indeed some functions were not exported any longer by libmysqlclient.so.18. This mysql 5.5 bug report explains that these functions were actually not official in the first place.
Anyway, I managed to get them back by editing the libmysql/CMakeLists.txt and rebuilding mysql 5.5.
After that, mysqlcc built without problems, but – as you already experienced as well – immediately segfaults.

If there is a “quick fix”, I could not find it. I guess that too much has changed…
I even tried version 1.0.1 of mysqlcc, but it had the same effect – it just did not need my patch any longer.

Maybe the mysqlcc author will eventually fix this, when mysql 5.5 becomes more popular, but I wouldn’t hold my breath

Hi! Had a chance to check back and continue. Your new patch works great! Not sure why my attempt at the same thing failed, probably cut out too much (like the argv[0] bit). This is awesome, I can use mysqlcc again! Thanks!