Unable to Build CPP libraries in 2.7.2a2 version
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Prasad_Krishnamorthy
Posted On:   Wednesday, February 20, 2002 10:34 PM

I am getting compilation errors for 3 files in the 2.7.2a2 build, when I use VC6. All the files get compiled when I use g++ (GNU) compiler, but I get a lot of unresolved externalls while liking. I have 2 questions: 1. What are the C++ compilers supported for the 2.7.2a2 version (preferably in Windows Platform). 2. The following are the errors that I got while using the VC compiler in WinNT - any solutions?. Please help! BaseAST.cpp BaseAST.cpp(337) : error C2201: 'nullASTptr' : must have external linkage in order to be exported/imported Token.cpp Token.cpp(40) : error C2491: 'Token::badToken' : definition of dllimport static data member   More>>

I am getting compilation errors for 3 files in the 2.7.2a2 build, when I use VC6. All the files get compiled when I use g++ (GNU) compiler, but I get a lot of unresolved externalls while liking.
I have 2 questions:

1. What are the C++ compilers supported for the 2.7.2a2 version (preferably in Windows Platform).

2. The following are the errors that I got while using the VC compiler in WinNT - any solutions?.

Please help!


BaseAST.cpp

BaseAST.cpp(337) : error C2201: 'nullASTptr' : must have external linkage in
order to be exported/imported


Token.cpp

Token.cpp(40) : error C2491: 'Token::badToken' : definition of dllimport static
data member not allowed


TreeParser.cpp

TreeParser.cpp(64) : error C2491: 'TreeParser::ASTNULL' : definition of
dllimport static data member not allowed
   <<Less

Re: Unable to Build CPP libraries in 2.7.2a2 version

Posted By:   Michael_Lindig  
Posted On:   Tuesday, March 26, 2002 11:10 PM

Hi



The problem is following statement in AST.HPP:



extern ANTLR_API AST* const nullASTptr;


change it to:



extern ANTLR_API AST const* nullASTptr;


should help.


For the other errors you have included the source files to your project and compile it with dllimport. If you include the project files into your project then you shall define ANTLR_API without dllimport dirctive.

About | Sitemap | Contact