thetna
thetna

Reputation: 7143

Compilation error in visual C++

I am using Visual studio 2010 for building C project. My project contains a number of header files,source file and parsers. It uses lex and bason files. I am getting a single error during the compilation and íé the following

abc.y:error C2065: 'INPUT' : undeclared identifier 

I tried the solutions I am getting like including

#define WIN32_WINNT >= 0x0501

in my main.c file before the inclusion of any of the header files.I am not able to get rid of this error. Could you please let me know what Can be the reasons for this error?

EDIT

The snippet of code that is showing error is:

     list_Cons(0, list_List((POINTER)INPUT)

The surprising thing is that If i alter INPUT into INPUT1, I get the same error. It is stoic to change.

Upvotes: 0

Views: 704

Answers (3)

spraff
spraff

Reputation: 33425

For myself I use CMake which can generate MSVC projects along with other build types. You can tell it that a .y needs to be processed outwith the C/C++ files and it will instruct MSVC to invoke whatever external tools are necessary to preprocess the non-C/C++ parts.

Upvotes: 0

Andy Johnson
Andy Johnson

Reputation: 8169

Presumably you read this and this.

#define WIN32_WINNT >= 0x0501 wont work. You should try using #define WIN32_WINNT 0x0501 instead.

Also, check that you are actually #including winuser.h

Upvotes: 2

aschepler
aschepler

Reputation: 72431

A C++ compiler cannot process a *.y file. For that you need a yacc / bison program, which does not come included with Visual Studio 2010.

Upvotes: 0

Related Questions