From: Ingo B. <ing...@we...> - 2006-02-14 14:44:29
|
Hello, I have the latest SWIG and Python versions and I tried to wrap a simple c (c++) example with swig but without success: example.c int fun(int x, int y) { int g; g = x + y; return g; } example.i %module example.i extern int fun(int x, int y); 1.) swig -python -c++ example.i => example_wrapper.cxx 2.) gcc -c -fpic example_wrapper.cxx -I/python/include -I/....... all the include paths THIS DOES NOT WORK, BUT PRODUCING THE MESSAGES example_wrap.cxx:760: error: syntax error before `.' token example_wrap.cxx:765: error: syntax error before `if' example_wrap.cxx:766: error: ISO C++ forbids declaration of `m' with no type example_wrap.cxx:766: error: conflicting types for `int m' example_wrap.cxx:763: error: previous declaration as `PyObject*m' example_wrap.cxx:767: error: ISO C++ forbids declaration of `d' with no type example_wrap.cxx:767: error: conflicting types for `int d' example_wrap.cxx:763: error: previous declaration as `PyObject*d' example_wrap.cxx:767: error: invalid conversion from `int' to `PyObject*' example_wrap.cxx:769: error: syntax error before `if' example_wrap.cxx:770: error: ISO C++ forbids declaration of `swig_types_initial ' with no type example_wrap.cxx:770: error: variable-size type declared outside of any function example_wrap.cxx:770: error: conflicting types for `int swig_types_initial[2]' example_wrap.cxx:743: error: previous declaration as ` swig_type_info*swig_types_initial[1]' example_wrap.cxx:770: error: syntax error before `++' token example_wrap.cxx:773: error: ISO C++ forbids declaration of `typeinit' with no type example_wrap.cxx:773: error: redefinition of `int typeinit' example_wrap.cxx:762: error: `int typeinit' previously defined here example_wrap.cxx:774: error: syntax error before `}' token example_wrap.cxx:775: error: ISO C++ forbids declaration of ` SWIG_Python_InstallConstants' with no type example_wrap.cxx:775: error: `int SWIG_Python_InstallConstants' redeclared as different kind of symbol example_wrap.cxx:659: error: previous declaration of `void SWIG_Python_InstallConstants(PyObject*, swig_const_info*)' example_wrap.cxx:775: error: initializer list being treated as compound expression example_wrap.cxx:775: error: invalid conversion from `swig_const_info*' to `int ' example_wrap.cxx:777: error: syntax error before `}' token who can help me? Thanks. Regards, Ingo ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 |