[PyKDE] SIP: example of documentation does not work ?

elho eh1 at delair.de
Wed Oct 12 12:09:58 BST 2005


>>>>> There seams be something wrong with the copies of the example files 
>>>>> from
>>>>> http://www.river-bank.demon.co.uk/docs/sip/sipref.html#a-simple-c-example 
>>>>>
>>>>>
>>>>> Is there a place to download the small file of this example to make 
>>>>> sure
>>>>> nothing of mine are wrong?
>>>>>
>>>>> This is whar I did - I run:
>>>>>    sip -c . word.sip
>>>>> ..and that's the answer:
>>>>>    sip: word.sip:2: syntax error
>>>>>
>>>>> Is there something to notice about the blancs or so? Here are my 
>>>>> files:
>>>>>
>>>>> --- word.h 
>>>>> ------------------------------------------------------------
>>>>> // Define the interface to the word library.
>>>>> class Word{
>>>>>    const char *the_word;
>>>>>  public:
>>>>>    Word(const char *w);
>>>>>    char *reverse() const;
>>>>> };
>>>>>
>>>>> --- word.sip 
>>>>> ----------------------------------------------------------
>>>>> // Define the SIP wrapper to the word library.
>>>>> %Module word 0
>>>>>
>>>>> class Word
>>>>> {
>>>>>    %TypeHeaderCode
>>>>>    #include <word.h>
>>>>>    %End
>>>>>
>>>>>  public:
>>>>>    Word(const char *w);
>>>>>    char *reverse() const;
>>>>> };
>>>>
>>>>
>>>>
>>>> Directives that include code must start at the beginning of a line.
>>>>
>>>> You'll also have to remove the argument name from the ctor.
>>>>
>>>> Phil
>>>
>>>
>>>
>>> Even when I change the word.sip to the following I got the same error:
>>>
>>> sip: word.sip:2: syntax error
>>>     by executing "sip -c . word.sip"
>>>
>>> So there must be something wrong at the beginning, not?
>>>
>>> --- word.sip ----------------------------------------------------------
>>> // Define the SIP wrapper to the word library.
>>> %Module word 0
>>> class Word
>>> {
>>> %TypeHeaderCode
>>> #include <word.h>
>>> %End
>>>
>>> public:
>>> Word(const char*);
>>> char *reverse() const;
>>> };
>>
>>
>>
>> What version of SIP are you using?
>>
>> The documentation describes SIP v4.
>>
>> Phil
>>
> 
> 
> 4.3.1 (4.3.1-SIP-4_3-362)
> 

I'm getting crazy - even if I delete the first lines of my "word.sip" 
file, it is the same error. May there be something wrong about my file? 
what will I need before "%Module.." ?

My be it is the easeast way to send me a working example for using sip, 
which I could try to run.
Is there a dokumentation / tutorial any where else than that one of 
river-bank?

thx a lot for helping




More information about the PyQt mailing list