On Tuesday 19 April 2011 12:21:33 brajesh rai wrote:
> I am trying to run the libfoo example on Windows. So far, I am able to run
> generatorrunner and create wrapper files, but during the link, I get the
> 'unresolved external symbol" error with respecte to the symbols from Qt
> libraries. I found out that this error is because of the '#define protected
> public' directive in the wrapper files. Is there any way this can be
> aoided? Please see below for some details on the error and also the
> snippet from a wrapper file.
> 
> I would appreciate any help on this.

It should be automatically disabled under Windows, I'm wondering why it's 
enable on your configuration.
 
> Thanks,
> 
> 
> 
> -------------------- generatorrunner -----------------
> 
> generatorrunner --generatorSet=shiboken --enable-parent-ctor-heuristic
> --enable-pyside-extensions -enable-return-value-heuristic global.h
> --include-paths="../libfoo;;../../../../../../../Qt/4.7.1/include;../../../
> ../../../../Qt/4.7.1/include/QtCore;../../../../../../../Qt/4.7.1/include/Q
> tGui"
> --typesystem-paths=".;"../../../../../3rdparty/include/pyside/PySide/QtCor
> e;../../../../../3rdparty/include/pyside/PySide/QtGui;../../../../../3rdpar
> ty/include/pyside/PySide"" --output-directory=. typesystem_foo.xml
> 
> ------------------------ link error output ------------------------
> 
> nmake -f Makefile.Debug
> 
> link /LIBPATH:"c:\Qt\4.7.1\lib" /NOLOGO /DEBUG /DLL /OUT:pyfoo.dll
> @C:\DOCUME~1\raib01\LOCALS~1\Temp\nm40F.tmp
> 
> Creating library pyfoo.lib and object pyfoo.exp
> 
> math_wrapper.obj : error LNK2001: unresolved external symbol "public:
> virtual void __thiscall QObject::disconnectNotify(char const *)"
> (?disconnectNotify@QObject@@UAEXPBD@Z)
> 
> math_wrapper.obj : error LNK2001: unresolved external symbol "public:
> virtual void __thiscall QObject::connectNotify(char const *)"
> (?connectNotify@QObject@@UAEXPBD@Z)
> 
> math_wrapper.obj : error LNK2001: unresolved external symbol "public:
> virtual void __thiscall QObject::customEvent(class QEvent *)"
> (?customEvent@QObject@@UAEXPAVQEvent@@@Z)
> 
> math_wrapper.obj : error LNK2001: unresolved external symbol "public:
> virtual void __thiscall QObject::childEvent(class QChildEvent *)"
> (?childEvent@QObject@@UAEXPAVQChildEvent@@@Z)
> 
> math_wrapper.obj : error LNK2001: unresolved external symbol "public:
> virtual void __thiscall QObject::timerEvent(class QTimerEvent *)"
> (?timerEvent@QObject@@UAEXPAVQTimerEvent@@@Z)
> 
> math_wrapper.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: virtual void __thiscall
> QObject::childEvent(class QChildEvent *)" (__imp_?childEvent@QObject
> @@UAEXPAVQChildEvent@@@Z) referenced in function "public: virtual void
> __thiscall MathWrapper::childEvent(class QChildEvent *)"
> (?childEvent@MathWrapper@@UAEXPAVQChildEvent@@@Z)
> 
> math_wrapper.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: virtual void __thiscall
> QObject::connectNotify(char const *)" (__imp_?connectNotify@QObject
> @@UAEXPBD@Z) referenced in function "public: virtual void __thiscall
> MathWrapper::connectNotify(char const *)" (?connectNotify@MathWrapper
> @@UAEXPBD@Z)
> 
> math_wrapper.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: virtual void __thiscall
> QObject::customEvent(class QEvent *)" (__imp_?customEvent@QObject
> @@UAEXPAVQEvent@@@Z) referenced in function "public: virtual void
> __thiscall MathWrapper::customEvent(class QEvent *)"
> (?customEvent@MathWrapper @@UAEXPAVQEvent@@@Z)
> 
> math_wrapper.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: virtual void __thiscall
> QObject::disconnectNotify(char const *)" (__imp_?disconnectNotify@QObject
> @@UAEXPBD@Z) referenced in function "public: virtual void __thiscall
> MathWrapper::disconnectNotify(char const *)" (?disconnectNotify@MathWrapper
> @@UAEXPBD@Z)
> 
> math_wrapper.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: virtual void __thiscall
> QObject::timerEvent(class QTimerEvent *)" (__imp_?timerEvent@QObject
> @@UAEXPAVQTimerEvent@@@Z) referenced in function "public: virtual void
> __thiscall MathWrapper::timerEvent(class QTimerEvent *)"
> (?timerEvent@MathWrapper@@UAEXPAVQTimerEvent@@@Z)
> 
> math_wrapper.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: static int __cdecl
> PySide::SignalManager::qt_metacall(class QObject *,enum
> QMetaObject::Call,int,void * *)" (__imp_?qt_metacall@SignalManager@PySide@
> @SAHPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z) referenced in function
> "public: virtual int __thiscall MathWrapper::qt_metacall(enum
> QMetaObject::Call,int,void * *)" (?qt_metacall@MathWrapper
> @@UAEHW4Call@QMetaObject@@HPAPAX@Z)
> 
> math_wrapper.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) void __cdecl PySide::initDynamicMetaObject(struct
> SbkObjectType *,struct QMetaObject const *)"
> (__imp_?initDynamicMetaObject@PySide@@YAXPAUSbkObjectType@@PBUQMetaObject@@
> @Z) referenced in function "void __cdecl init_Math(struct _object *)"
> (?init_Math@@YAXPAU_object@@@Z)
> 
> math_wrapper.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) void __cdecl PySide::initQObjectSubType(struct
> SbkObjectType *,struct _object *,struct _object *)"
> (__imp_?initQObjectSubType@PySide@@YAXPAUSbkObjectType@@PAU_object@@1@Z)
> referenced in function "void __cdecl init_Math(struct _object *)"
> (?init_Math@@YAXPAU_object@@@Z)
> 
> math_wrapper.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) void __cdecl
> PySide::Signal::updateSourceObject(struct _object *)"
> (__imp_?updateSourceObject@Signal@PySide@@YAXPAU_object@@@Z) referenced in
> function _Sbk_Math_Init
> 
> math_wrapper.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) bool __cdecl PySide::fillQtProperties(struct _object
> *,struct QMetaObject const *,struct _object *,char const * *,unsigned int)"
> (__imp_?fillQtProperties@PySide@@YA_NPAU_object@@PBUQMetaObject@@0PAPBDI@Z)
> referenced in function _Sbk_Math_Init
> 
> pyfoo.dll : fatal error LNK1120: 15 unresolved externals
> 
> 
> 
> --------------------- math_wrapper.cpp ------------------
> 
> //workaround to access protected functions
> 
> #define protected public
> 
> // default includes
> 
> #include <shiboken.h>
> 
> #include <pysidesignal.h>
> 
> #include <pysideproperty.h>
> 
> #include <pyside.h>
> 
> #include <typeresolver.h>
> 
> #include <typeinfo>
> 
> #include <signalmanager.h>
> 
> #include <pysidemetafunction.h>
> 
> #include "foo_python.h"
> 
> #include "math_wrapper.h"
> 
> // Extra includes
> 
> #include <QList>
> 
> #include <qbytearray.h>
> 
> #include <qcoreevent.h>
> 
> #include <qobject.h>
> 
> #include <qobjectdefs.h>
> 
> #include <qthread.h>
> 
> 
> 
> // Native ---------------------------------------------------------
> 
> MathWrapper::MathWrapper() : Math() {
> 
> // ... middle
> 
> }
> 
> ....................
> 
> ...................

-- 
Hugo Parente Lima
INdT - Instituto Nokia de Tecnologia

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
PySide mailing list
[email protected]
http://lists.pyside.org/listinfo/pyside

Reply via email to