[antlr-interest] C++ compile issue with ANTLR 3.1.0b1 C runtime files

Jim Idle jimi at temporal-wave.com
Thu Mar 13 10:44:41 PDT 2008


Hmm, how are you compiling it? I have no come across this and I just 10 seconds ago compiled generated code as C++ to fix a casting issue that someone else reported. If you have all the correct headers and include paths set up, then you should find in winsock.h:

 

typedef UINT_PTR        SOCKET;

 

Right clicking on the SOCKET declaration in antlr3debugeventlistener.h should take you straight to it (once you have compiled and have the browse info etc). So, if it doesn't then there is something amiss with your build environment, or you have perhaps #defined something before including the antlr3.h header, or in the project etc, which is causing the winsock includes to not include themselves.

 

Including antlr3.h should include everything for you regardless of the operating system/compiler, so it would be nice to get to the bottom of this so we can solve it for others in advance ;-) This error usually means that you are including the wrong headers. Did you load the .Net SDK or otherwise change the default header locations for VS 2005? This kind of error comes up when you install the wrong platform SDKs or out of date ones, but after VS2005 these types of problems seemed to go away because the header include order was fixed. 

 

Finally, you have installed VS2005 SP 1 right?

 

Jim

 

 

 

From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-bounces at antlr.org] On Behalf Of Chris Snyder
Sent: Thursday, March 13, 2008 10:13 AM
To: antlr-interest at antlr.org
Subject: [antlr-interest] C++ compile issue with ANTLR 3.1.0b1 C runtime files

 

I'm trying to compile my C output in CPP and I get this error

 

libantlr3c-3.1.0b1\include\antlr3debugeventlistener.h(42) : error C2146: syntax error : missing ';' before identifier 'socket'

 

which corresponds to this:

 

antlr3debugeventlistener.h

/// The socket structure we receive after a successful accept on the serverSocket

///

SOCKET                        socket;

 

I looked for the SOCKET definition and didn't find one being used in my configuration. I did find a UNIX definition in antlr3defs.h:

 

// SOCKET not defined on Unix

// 

typedef     int                     SOCKET;

 

but it is not even reached because preprocessor ANTLR3_WINDOWS is defined 

 

Should I be including a windows socket header?

 

I'm in windows XP using VS2005 and VC++ 2005.

 

Thanks,

Chris

 

 

T-VEC Technologies, Inc.

 



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080313/3019a264/attachment-0001.html 


More information about the antlr-interest mailing list