MySQL undefined references

Bug #877458 reported by David Doucette
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mysql-5.1 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

I just upgraded from 11.04 to 11.10. I use a shell script to compile and make CGIs that looks like this:

g++ $(mysql_config --cflags) $(mysql_config --libs) $1.cpp
chmod 755 a.out
mv a.out /home/lts/public_html/cgi-bin/$1.cgi

This has been working for years, and now throws "undefined reference" errors to every MySQL function I use. I used Synaptic (after I had to download it!) to remove MySqL server, client, libraries, etc. in case the upgrade got messed up, but it doesn't help.

I have a development project that's now dead in the water. I have a second PC and plan to put either 11.4 or the LTS version on it, but I'm hoping I can get 11.10 running before it comes to this.

Thank you.

Revision history for this message
Julian Taylor (jtaylor) wrote :

This is due to a toolchain change in oneiric.
Now by default the linker flag --as-needed is used, which requires you to place the libraries behind objects needing their symbols.
See: https://wiki.ubuntu.com/NattyNarwhal/ToolchainTransition
A fix should be to simply do this:

g++ $(mysql_config --cflags) $1.cpp $(mysql_config --libs)

Changed in mysql-5.1 (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.