[antlr-interest] Using ANTLR on MSV .NET 2k3

Randolph Tan ren_c_tan at yahoo.com
Tue Nov 21 23:22:56 PST 2006


Greetings!
   
  Sorry to bother the thread again.
   
  I gave up on buildiing the antlr on MinGW and used antler.net-2.7.6 executable instead for generating a C++ source code.
   
  And now, I am encountering another kind of problem during linking (symbol already defined).
   
  Here are the steps I did:
   
  Then, I added all .cpp and .hpp files under antlr-2.7.6\lib\cpp\antlr and antlr-2.7.6\lib\cpp\src to the project.
   
  I modified the sample grammar of the "cut and paste" tutorial from the ANTLR getting started to output C++. I also created a main function (translated Java example to C++).
   
  As I try to build the project, I got these errors:
  fatal error C1010: unexpected end of file while looking for precompiled header directive L.cpp
   
  MSDN says:
  ------------------------------------------------------------------------------------------------------------------
  A precompiled header did not contain a precompiled header directive.
   
  Possible Cause:
  1. Incorrect file specified as a header file.
  2. An include file with /YU (Use Precompiled Header) is not listed in the souce file)
  ------------------------------------------------------------------------------------------------------------------
  I don't really understood what that meant but after I set both all cpp files to "not using precomiled headers", the project was able to compile succesfully.
   
  Then the build failed at linking with 20 errors and 19 warnings.
  One sample error (all of the errors are similar, just different symbols or different object files):
  CharScanner.obj : error LNK2005: "private: static int const antlr::CharScanner::NO_CHAR" (?NO_CHAR at CharScanner@antlr@@0HB) already defined in ANTLR test.obj
   
  Btw, if there is a link to a tutorial using ANTLR on MVS .NET. Please tell me! Thanks!
   
  PS. I am just curious, why does everybody want to build ANTLR into a library? If it can be built, why doesn't antler.org add it in its downloads section?
   
  Reference (These might help, I just followed their suggestions blindly, since I don't know what the build settings really meant):
  http://www.antlr.org/pipermail/antlr-interest/2006-March/015683.html
  http://www.antlr.org/pipermail/antlr-interest/2002-August/001693.html

 Send instant messages to your online friends http://uk.messenger.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20061122/5cd28f40/attachment.html 


More information about the antlr-interest mailing list