Active Topics

 


Reply
Thread Tools
Posts: 190 | Thanked: 129 times | Joined on Mar 2010 @ Bavaria, Germany
#1
Hello,

I'm testing the python embedding with PyQt4 but unfortunately the loading in scratchbox fails with a strange message. The same code runs fine on Windows XP.

Code:
Traceback (most recent call last):
  File "/home/gri/web2sms-0.1.1/dist/providers/provider_test.py", line 22, in <module>
    from PyQt4 import QtCore, QtGui
ImportError: /usr/lib/python2.5/site-packages/PyQt4/QtCore.so: undefined symbol: PyProperty_Type
Google only finds one debian bugreport related to this. But there's no answer

So maybe someone here knows why this error happens.

C++ source of python initialization
Source of python script
 
Posts: 190 | Thanked: 129 times | Joined on Mar 2010 @ Bavaria, Germany
#2
Small update on this.

I found out funny things about the following lines of code:
Code:
Py_Initialize();

PyRun_SimpleString("from PyQt4 import QtCore, QtGui");
if ( PyErr_Occurred() )
  PyErr_Print();  

Py_Finalize();
Run these lines in the main program: works.
Run these lines in a shared library which the main program loads at startup: works.
Run these lines in a shared library which is loaded using QLibraryLoader at runtime: the error described in the first post

So what now? Is there anything magic I don't know when using shared library runtime loading?
 
Posts: 6 | Thanked: 3 times | Joined on May 2010
#3
Originally Posted by gri View Post
So what now? Is there anything magic I don't know when using shared library runtime loading?
Try playing with the load hints if you're using QLibrary to load Python, especially ExportExternalSymbolsHint:

http://doc.qt.nokia.com/4.6/qlibrary.html#LoadHint-enum
 

The Following 2 Users Say Thank You to :-) For This Useful Post:
Posts: 190 | Thanked: 129 times | Joined on Mar 2010 @ Bavaria, Germany
#4
Thanks mate! I should have known that but overlooked it all the time

You made my day
 
Reply


 
Forum Jump


All times are GMT. The time now is 02:19.