Thanks for the reply.
I did actually manage to find a semi workaround for this though it is a bit cumbersome (involves manually editing the extern "C" scopes in the tree grammar .h generated file). I am a bit of a C++ newbie and part of me is curious if this extern "C" stuff is really needed here since I am compiling everything with g++. Unfortunately given how the declarations look in the header it seems that since in certain cases I am returning stl types these show up in some of the generated structs in the header i suspect that #ifdefing them out of the header would mean the header would not compile. --- On Fri, 2/13/09, Robert Soule <[email protected]> wrote: > From: Robert Soule <[email protected]> > Subject: Re: [antlr-interest] c runtime with templates > To: [email protected] > Cc: [email protected] > Date: Friday, February 13, 2009, 6:36 AM > Try adding this to your grammar: > > @header { > #ifndef _YourFile_H > #include <your_includes> > using namespace std; > #endif > } > > where you replace YourFile and your_includes appropriately. > I think that you want to be able to include your stl > related stuff > in your .c file, but not in your header file, and the above > should > work. > > -Robert > > On Fri, Feb 13, 2009 at 3:52 AM, Carter Cheng > <[email protected]> wrote: > > > > Hi, > > > > I have been playing around with intermingling the C > runtime with some C++ STL constructs (admittedly not > exception safe) and noticed I that I get what I believe are > linker errors doing to interactions between the extern > "C" { ... } declaration which shows up in the > header file and stl includes such as #include <list> > etc. > > > > Is there a way workaround this issue (ignoring for the > moment the issue of STL containers throwing exceptions in C > code which are uncaught). > > > > Thanks in advance, > > > > Carter > > > > > > > > > > List: > http://www.antlr.org/mailman/listinfo/antlr-interest > > Unsubscribe: > http://www.antlr.org/mailman/options/antlr-interest/your-email-address > > List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en -~----------~----~----~----~------~----~------~--~---
