MySQL Forums
Forum List  »  Connector/C++

Re: Error: undefined reference to get_driver_instance
Posted by: Thomas Tronstad
Date: September 23, 2009 08:01AM

I had this problem myself and it did indeed turn out to be a linker problem.
The function in question appears to be in a shared library, in my case /usr/local/lib/libmysqlcppconn.so.
So you would have to link this shared library with your code to make everything work.

I also had an issue where /usr/local/lib wasn't among the search paths for libraries so when i tried to run my successfully linked program i would get a new errormessage "/usr/bin/ld: cannot find -lobjc/usr/local/lib/libmysqlcppconn.so".
The solution to this problem is to add '/usr/local/lib' (without quotes) to the file /etc/ld.so.conf, and then run ldconfig to make sure the new setting is applied.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.