Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » [SOLVED] Ubuntu 11.10 upgrade + upgrade Galileo to Eclipse Indigo - now linking fails(CDT: Linking to mysql c++ connector fails: undefined reference to get_driver_instance)
[SOLVED] Ubuntu 11.10 upgrade + upgrade Galileo to Eclipse Indigo - now linking fails [message #843947] Fri, 13 April 2012 10:29 Go to next message
Eclipse UserFriend
I had Ubuntu 10.10 running with Galileo and mysql 5.5 and the project compiled fine.
I then upgraded to Ubuntu 11.10, which included an upgrade to Galileo.
Shocked I found the projects in their workspaces, but the mysql projects keep failing with "undefined reference to get_driver_instance".

I downloaded mysql source and compiled and installed and ran the tests and it works.
I downloaded the C++ connector source, compliled and installed.
I set the "Libaray Search Path" in Eclipse (I even copied the libmysqlcppconn.so etc to /usr/lib).
I included mysqlcppconn in the Libraries under tool settings.

When I compile I still get "Undefined reference to get_driver_instance". I also tried to compile from a terminal window using the text from the Eclipse console window, but still the same problem.
Here is the console linker line:

g++ -L/usr/local/lib -o"CImageFrame" ./CImageFrame.o
/usr/local/lib/libmysqlcppconn-static.a -lMagick++ -lmysqlcppconn

I have tried with and without the static library.

Any suggestions will be greatly appreciated.




[Updated on: Fri, 13 April 2012 16:58] by Moderator

Re: Ubuntu 11.10 upgrade + upgrade Galileo to Eclipse Indigo - now linking fails [message #844152 is a reply to message #843947] Fri, 13 April 2012 14:50 Go to previous messageGo to next message
Eclipse UserFriend
A quick Google search of "get_driver_instance" turns up multiple entries indicating that this is a linking problem having to do with name spaces and including correct libraries.
Re: Ubuntu 11.10 upgrade + upgrade Galileo to Eclipse Indigo - now linking fails [message #844231 is a reply to message #844152] Fri, 13 April 2012 16:53 Go to previous message
Eclipse UserFriend
I did EXTENSIVE googling but eventually got the amswer from a request on the Ubuntu forum.
It was always clearly a linking problem, it was why and how to fix it. The libraries being used are the correct ones and were built from source to ensure compatibility.

t1497f35 replied there:
11.10 did the ( http-s://wiki.ubuntu.com/NattyNarwhal/ToolchainTransition) toolchain transition and people reporting about undefined stuff while compiling are usually those unaware of this transition and hence affected by this. Make sure you're only doing only direct linking and other stuff as specified above.


So it turns out it was a problem created by the new tool chains, they being much less forgiving of library sequences and also about EXPLICITLY inclduing all required libraries.


IT MIGHT BE WORTH IT FOR A MODERATOR TO MAKE A STICKY ABOUT THIS AS IT WILL CATCH MANY DEBIAN/UBUNTU USERS WHEN THEY UPGRADE.

[Updated on: Fri, 13 April 2012 17:04] by Moderator

Previous Topic:mingw32/bin/ld.exe: cannot find -lCImg
Next Topic:eclipse cdt book
Goto Forum:
  


Current Time: Tue Jun 17 19:41:21 EDT 2025

Powered by FUDForum. Page generated in 0.03349 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top