From: Stephen T. <ste...@gm...> - 2011-10-06 17:34:21
|
On Thu, Oct 6, 2011 at 1:23 PM, David Piepgrass <dpi...@me...> wrote: >> I am having difficulty in renaming operators that are in the project >> namespace. I have placed my %rename ahead of the line that includes the >> header. Even with doing that I get back a cryptic and that is not helpful saying >> "longitude.hpp(123) : Error: Syntax error in input(1).". From the message I >> see that I have committed some syntax error. Fine but what is wrong with it? >> That is why I call the error message not helpful. If the error message is >> intended to alert me to something not representable in the target language >> then perhaps say: > ... >> C:\MyCode\longitude.hpp(123) : Error: Cannot generate code for >> dted::units::operator<(Longitude const&, Longitude const&) > > The error says "syntax error", so I would look for a syntax error. "Cannot generate code" would not be a syntax error (and if you got that error then you would probably still be asking why you got it.) My guess why you got this error is that you left out the function's return type (bool): > >> %rename(LonLessThan) operator< ( Longitude const& , Longitude const& ); When say that I have a syntax error here is the problem in the C++ header file or the SWIG file. I took your suggestion as meaning the SWIG file so I changed the rename line to read: %rename(LonLessThan) bool operator< ( Longitude const&, Longitude const& ); That still fails at line 123 in longitude.hpp. I re-read the documentation on the %rename function and I don't see any of the examples returning their type. Is there a way to dump out the parse tree so I can at least see why the parser is coughing up this error message? Stephen |