From: Haimo Z. <Hai...@ce...> - 2007-01-23 05:09:30
|
Hello, Using: Swig 1.3.31, C++, Python2.4.2, Linux I am getting a syntax error in a templated class forward declaration, like this % swig -Wall -c++ -python -classic -I<somepath> -o A_wrap.cxx A.i <somepath>/someplace/B.hh:29: Error: Syntax error in input(1). How can I get around this without changing the header file, which I don't own? My %ignore aClassIwantToIgnore; seems to have now effect. Thanks for any help. - Haimo file A.i: --------- %module A; %include "B.i" file B.i: --------- %include "typemaps.i" %include "exception.i" %include "std_list.i" %include "std_string.i" %{ // copy verbatim #include <string> #include <list> #include <map> #include "someplace/B.hh" %} // %ignore statements %ignore aClassIwantToIgnore; // ... plus several other %ignore // some typemaps follow here // now process the B.hh header file %include "someplace/B.hh" file B.hh: (which I don't own and cannot change) ---------- // ... various #include statements template <class, class, class> class aClassIwantToIgnore; // line 29: the forward declaration class B { template <class, class, class> friend class aClassIwantToIgnore; public: // a number of method declarations that don't give problems // some of which I want to also ignore } |
From: Nitro <ni...@dr...> - 2007-01-23 11:16:05
|
Am 23.01.2007, 06:09 Uhr, schrieb Haimo Zobernig <Hai...@ce...>: > Hello, > > Using: Swig 1.3.31, C++, Python2.4.2, Linux > I am getting a syntax error in a templated class forward declaration, > like this > > % swig -Wall -c++ -python -classic -I<somepath> -o A_wrap.cxx A.i > > <somepath>/someplace/B.hh:29: Error: Syntax error in input(1). > > How can I get around this without changing the header file, which I > don't own? > My %ignore aClassIwantToIgnore; seems to have now effect. Instead of %including the header you can always copy it into the interface file, delete the offending line and that's it. |
From: William S F. <ws...@fu...> - 2007-01-24 21:52:41
|
Nitro wrote: > Am 23.01.2007, 06:09 Uhr, schrieb Haimo Zobernig <Hai...@ce...>: > >> Hello, >> >> Using: Swig 1.3.31, C++, Python2.4.2, Linux >> I am getting a syntax error in a templated class forward declaration, >> like this >> >> % swig -Wall -c++ -python -classic -I<somepath> -o A_wrap.cxx A.i >> >> <somepath>/someplace/B.hh:29: Error: Syntax error in input(1). >> >> How can I get around this without changing the header file, which I >> don't own? >> My %ignore aClassIwantToIgnore; seems to have now effect. > > Instead of %including the header you can always copy it into the interface > file, delete the offending line and that's it. > Mmm, yup, SWIG doesn't seem to parse some forward templated class declarations. Please log this as a bug noting that: template <class A, class B, class C> class aClassIwantToIgnore; parses okay, but the following does not: template <class, class, class> class aClassIwantToIgnore; I'm afraid I can't think of any other workarounds. William |
From: Nitro <ni...@dr...> - 2007-01-25 11:04:31
|
Am 24.01.2007, 22:52 Uhr, schrieb William S Fulton = <ws...@fu...>: > Nitro wrote: >> Am 23.01.2007, 06:09 Uhr, schrieb Haimo Zobernig = >> <Hai...@ce...>: >> >>> Hello, >>> >>> Using: Swig 1.3.31, C++, Python2.4.2, Linux >>> I am getting a syntax error in a templated class forward declaration= , >>> like this >>> >>> % swig -Wall -c++ -python -classic -I<somepath> -o A_wrap.cxx A.i >>> >>> <somepath>/someplace/B.hh:29: Error: Syntax error in input(1). >>> >>> How can I get around this without changing the header file, which I >>> don't own? >>> My %ignore aClassIwantToIgnore; seems to have now effect. >> >> Instead of %including the header you can always copy it into the = >> interface >> file, delete the offending line and that's it. >> > Mmm, yup, SWIG doesn't seem to parse some forward templated class > declarations. Please log this as a bug noting that: > > template <class A, class B, class C> class aClassIwantToIgnore; > > parses okay, but the following does not: > > template <class, class, class> class aClassIwantToIgnore; > > I'm afraid I can't think of any other workarounds. > > William > That bug is already two times in the db = ( http://sourceforge.net/tracker/index.php?func=3Ddetail&aid=3D1538522&g= roup_id=3D1645&atid=3D101645 = and = http://sourceforge.net/tracker/index.php?func=3Ddetail&aid=3D1338527&gro= up_id=3D1645&atid=3D101645 = ), so no need to log it again. |
From: William S F. <ws...@fu...> - 2007-01-25 23:54:20
|
Nitro wrote: > Am 24.01.2007, 22:52 Uhr, schrieb William S Fulton > <ws...@fu...>: > >> Nitro wrote: >>> Am 23.01.2007, 06:09 Uhr, schrieb Haimo Zobernig >>> <Hai...@ce...>: >>> >>>> Hello, >>>> >>>> Using: Swig 1.3.31, C++, Python2.4.2, Linux >>>> I am getting a syntax error in a templated class forward declaration, >>>> like this >>>> >>>> % swig -Wall -c++ -python -classic -I<somepath> -o A_wrap.cxx A.i >>>> >>>> <somepath>/someplace/B.hh:29: Error: Syntax error in input(1). >>>> >>>> How can I get around this without changing the header file, which I >>>> don't own? >>>> My %ignore aClassIwantToIgnore; seems to have now effect. >>> >>> Instead of %including the header you can always copy it into the >>> interface >>> file, delete the offending line and that's it. >>> >> Mmm, yup, SWIG doesn't seem to parse some forward templated class >> declarations. Please log this as a bug noting that: >> >> template <class A, class B, class C> class aClassIwantToIgnore; >> >> parses okay, but the following does not: >> >> template <class, class, class> class aClassIwantToIgnore; >> >> I'm afraid I can't think of any other workarounds. >> >> William >> > > That bug is already two times in the db ( > http://sourceforge.net/tracker/index.php?func=detail&aid=1538522&group_id=1645&atid=101645 > and > http://sourceforge.net/tracker/index.php?func=detail&aid=1338527&group_id=1645&atid=101645 > ), so no need to log it again. > Indeed so it is. I've just fixed it though in svn, if you want give it a whirl. William |