[PyQt] SIP: Struggling to build multiple C++ classes for one python module.

Christoff Kok christoff.kok at ex-mente.co.za
Tue May 6 07:11:21 BST 2014


Phil, thanks again. It works and works quite well for us.

Kind Regards,
Christoff


On 5 May 2014 17:03, Phil Thompson <phil at riverbankcomputing.com> wrote:

> On 05/05/2014 2:49 pm, Christoff Kok wrote:
>
>> Hi,
>>
>> I am struggling to get my multiple C++ classes (each in their own .sip
>> file) to build for the same module. The documentation is not helping
>> me enough yet.
>>
>> Currently I am testing with 2 classes: Entity and NamedEntity
>>  Entity.sip and NamedEntity.sip's first line of code = "%Module
>> emsim"
>> When I try build it with my setup.py script, the following error
>> appears:
>> "
>>
>> D:Ex MenteSoftwareExMente.Sim 4 PrototypesEMSIM4EMSIM4Py>python
>>
>> setup.py install
>> running install
>> running build
>> running build_ext
>> building 'emsim' extension
>> C:Python33sip.exe -c buildtemp.win32-3.3Release -b
>> buildtemp.win32-3.3ReleaseEntity.sbf -I C:Python33sip "D:...
>> ...Entity.sip"
>> C:Python33sip.exe -c buildtemp.win32-3.3Release -b
>> buildtemp.win32-3.3ReleaseNamedEntity.sbf -I C:Python33sip "D:\...
>> ...NamedEntity.sip"
>>
>> sip: Entity.sip:2: Module is already defined
>> error: command 'C:Python33sip.exe' failed with exit status 1
>>
>> "
>>
>> When I remove the %Module line in NamedEntity, I receive an error that
>> there is no %Module defined for the class. When I make NamedEntity's
>> %Module line a %ConsolidateModule, I received the same "Module is
>> already defined' error as described above.
>>
>> I am sure I am missing something or understanding the Module /
>> ConsolidateModule concept wrong.
>>
>
> Forget about consolidated modules - that's advanced stuff.
>
> As far as SIP is concerned there is one logical .sip file per Python
> module. You can break it into multiple actual .sip files and use the
> %Include directive much like you would use #include in C/C++.
>
> If you are going to use one .sip file per class then it's best to have
> another "master" .sip file that contains stuff not related to any
> particular class (like the %Module directive) and have %Include directives
> for each of the individual class .sip files.
>
> Phil
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt




-- 
Christoff Kok
Software Engineer
Ex Mente

http://www.ex-mente.co.za
christoff.kok at ex-mente.co.za
PO Box 10214
Centurion
0046
South Africa
tel: +27 12 743 6993
tel: +27 12 654 8198
fax: +27 85 150 1341
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140506/38869431/attachment.html>


More information about the PyQt mailing list