473,385 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Undefined symbol __pure_virtual when importing MySQLdb

I downloaded MySQL-python-1.2.1 from SourceForge and installed it on a
Mandrake system (Mandrake Linux 9.2 3.3.1-2mdk on linux2).

The installation was successful. The gcc version is 3.3.

My Python version is 2.4.2. When I import MySQLdb, I get an error
which says that __pure_virtual is an undefined symbol.

Look:
>>import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/python2.4/site-packages/MySQLdb/__init__.py", line
19, in ?
import _mysql
ImportError: /usr/local/python2.4/site-packages/_mysql.so: undefined
symbol: __pure_virtual

By the way, mysql (5.0.27-standard)is running OK on the Mandrake
system. Look:

[antonyliu@myhost antonyliu]$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13 to server version: 5.0.27-standard

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

I have googled hard, and did see someone asking the same question, but
haven't found a good solution to this problem. Could anyone give me a
hint? Thanks a lot!

Jan 5 '07 #1
4 2081
an***********@yahoo.com wrote:
I have googled hard, and did see someone asking the same question, but
haven't found a good solution to this problem. Could anyone give me a
hint? Thanks a lot!
googling for "undefined symbol: __pure_virtual" brings up hundreds of
posts on this topic, and the answer is *always* to make sure that you're
linking with a version of the C++ libraries that matches your compiler.

</F>

Jan 5 '07 #2
Fredrik Lundh wrote:
an***********@yahoo.com wrote:
I have googled hard, and did see someone asking the same question, but
haven't found a good solution to this problem. Could anyone give me a
hint? Thanks a lot!

googling for "undefined symbol: __pure_virtual" brings up hundreds of
posts on this topic, and the answer is *always* to make sure that you're
linking with a version of the C++ libraries that matches your compiler.

</F>
Hi, thanks. I followed the strategy provided at the following url

http://www.mail-archive.com/db******.../msg27851.html

by adding "-lmygcc" to the end of the librarys to link. I added it to
the end of this line in the mysql_config script like so:

libs=" $ldflags -L$pkglibdir -lmysqlclient -lz -lcrypt -lnsl -lm
-lmygcc "

And then I recompiled the MySQL-python-1.2.1 package, but the same
problem remains.

Jan 5 '07 #3
an***********@yahoo.com wrote:
Fredrik Lundh wrote:
an***********@yahoo.com wrote:
I have googled hard, and did see someone asking the same question, but
haven't found a good solution to this problem. Could anyone give me a
hint? Thanks a lot!
googling for "undefined symbol: __pure_virtual" brings up hundreds of
posts on this topic, and the answer is *always* to make sure that you're
linking with a version of the C++ libraries that matches your compiler.

</F>

Hi, thanks. I followed the strategy provided at the following url

http://www.mail-archive.com/db******.../msg27851.html

by adding "-lmygcc" to the end of the librarys to link. I added it to
the end of this line in the mysql_config script like so:

libs=" $ldflags -L$pkglibdir -lmysqlclient -lz -lcrypt -lnsl -lm
-lmygcc "

And then I recompiled the MySQL-python-1.2.1 package, but the same
problem remains.
I tried using -lgcc as some people suggested in some forum, but it does
not resolve the problem. It looks like many people are having this
problem, but no solution has been offered so far. Anybody has a clue?
Thanks.

Jan 5 '07 #4
hg
an***********@yahoo.com wrote:
I downloaded MySQL-python-1.2.1 from SourceForge and installed it on a
Mandrake system (Mandrake Linux 9.2 3.3.1-2mdk on linux2).

The installation was successful. The gcc version is 3.3.

My Python version is 2.4.2. When I import MySQLdb, I get an error
which says that __pure_virtual is an undefined symbol.

Look:
>>>import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/python2.4/site-packages/MySQLdb/__init__.py", line
19, in ?
import _mysql
ImportError: /usr/local/python2.4/site-packages/_mysql.so: undefined
symbol: __pure_virtual

By the way, mysql (5.0.27-standard)is running OK on the Mandrake
system. Look:

[antonyliu@myhost antonyliu]$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13 to server version: 5.0.27-standard

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

I have googled hard, and did see someone asking the same question, but
haven't found a good solution to this problem. Could anyone give me a
hint? Thanks a lot!

Hi,

I can only say that it runs fine under Mandriva 2007 ... and that Mandriva
went to gcc V4 long after 9.2 ... maybe an issue here.

Regards,

hg

Jan 5 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Andreas Jung | last post by:
I am trying to embed Python within a C++ application (Linux, Python2.3.4). I am using the example from the example from the "Embeding and Extending" docs. This works fine importing a simple module...
1
by: Stu | last post by:
I am trying to build the xerces shared library with 2.3.0 version of their source code on an AIX 5.1 32 bit machine with the following version of the g++ compiler /usr/local/bin/g++ -v Reading...
0
by: francescomoi | last post by:
Hello. Python 2.3.4 (#1, Feb 2 2005, 12:11:53) on linux2 MySQL-python-1.2.0 I'm trying to execute this script: ---------------------- #!/usr/bin/python import MySQLdb
0
by: thomas Armstrong | last post by:
Hello. Python 2.3.4 (#1, Feb 2 2005, 12:11:53) on linux2 MySQL-python-1.2.0 I'm trying to execute this script: ---------------------- #!/usr/bin/python import MySQLdb
1
by: yamitmehta | last post by:
When I compile to code using g++arm of VxWorks 5.5 and put it on my board i get the follwing undefined symbols:- Cpool and Csingleton are template classes. CPool has the static member...
1
by: grbgooglefan | last post by:
I am importing cStringIO module in my PythonC++ embedded program. The import is failing with the following error: ImportError: /usr/lib/python2.3/lib-dynload/cStringIO.so: undefined symbol:...
1
by: Borse, Ganesh | last post by:
Hi, Can you please guide me for the following problem? The call to "PyImport_ImportModule("cStringIO");" is failing with an error of "undefined symbol: PyObject_SelfIter". Before importing this...
8
by: martinnorth | last post by:
Hi, I am running Python and MySQL on Ubuntu and have installed MySQLdb. If I try to import MySQLdb I get the following error: ActivePython 2.5.2.2 (ActiveState Software Inc.) based on Python...
3
by: Lawrence D'Oliveiro | last post by:
In message <mailman.109.1216158151.922.python-list@python.org>, Cyril Bazin wrote: What's the error message? This should be in Apache's error_log file.
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.