472,794 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,794 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 2057
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.
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.