[PyKDE] Syntax Errors With SIP Generated Files

Goran Spuzic goran.spuzic at motorola.com
Fri Mar 15 14:31:39 GMT 2002


Hi All,

I am trying a very very very simple example with SIP. After I run SIP on
the .sip file I am getting syntax errors when I try to compile the
results with g++. I'm using SIP 3.0 on SunOS 5.5.1 with g++
egcs-2.91.66. The files and commands I use are listed below;

coordinate.h
-------------
class Coordinate
{

public:

    Coordinate(int , int );
    int Print();
    int x,y;

};

coordinate.cc
--------------
#include "coordinate.h"
#include <iostream>
Coordinate::Coordinate(int x, int y):x(x),y(y)
{

}
int Coordinate::Print()
{
    cout << "X-" << x << "\nY-" << y << "\n";
}

coordinate.sip
--------------
%Module Coordinate

class Coordinate
{
%HeaderCode
#include <iostream>
#include "coordinate.h"
%End

public:
    Coordinate(int, int);
    void Print();
};

UNIX commands
-----------
sip -s ".cc" coordinate.sip
g++ -c sipCoordinateCoordinate.cc Coordinatecmodule.cc -I.
-I/home/gspuzic/sip -I. -I/app/Python-2.2/include/python2.2/
-I/app/Python-2.2/include/python2.2/config

Output
------
In file included from sipCoordinateCoordinate.cc:5:
sipCoordinateDeclCoordinate.h:17: syntax error before `char'
sipCoordinateDeclCoordinate.h:18: syntax error before `char'
In file included from sipCoordinateCoordinate.cc:6:
sipCoordinateCoordinate.h:15: syntax error before `*'
sipCoordinateCoordinate.h:16: syntax error before
`sipClassAttrTab_Coordinate'
sipCoordinateCoordinate.h:18: syntax error before `const'
sipCoordinateCoordinate.h:19: syntax error before `*'
sipCoordinateCoordinate.h:21: syntax error before `*'
sipCoordinateCoordinate.cc:9: syntax error before `*'
sipCoordinateCoordinate.cc:11: `sipThisType' was not declared in this
scope
sipCoordinateCoordinate.cc:11: parse error before `)'
sipCoordinateCoordinate.cc:13: syntax error before `='
sipCoordinateCoordinate.cc:40: syntax error before `*'
sipCoordinateCoordinate.cc:51: `Py_None' was not declared in this scope
sipCoordinateCoordinate.cc:51: warning: ANSI C++ forbids declaration
`Py_INCREF' with no type
sipCoordinateCoordinate.cc:52: parse error before `return'
sipCoordinateCoordinate.cc:58: `sipArgsParsed' was not declared in this
scope
sipCoordinateCoordinate.cc:58: `sipName_Coordinate_Coordinate' was not
declared in this scope
sipCoordinateCoordinate.cc:58: `sipName_Coordinate_Print' was not
declared in this scope
sipCoordinateCoordinate.cc:58: warning: ANSI C++ forbids declaration
`sipNoMethod' with no type
sipCoordinateCoordinate.cc:58: warning: initializer list being treated
as compound expression
sipCoordinateCoordinate.cc:60: parse error before `return'
sipCoordinateCoordinate.cc:65: type specifier omitted for parameter
sipCoordinateCoordinate.cc:65: parse error before `*'
(...THERE IS MORE ...)






More information about the PyQt mailing list