开发者

unexpected type '<unnamed-tag>'

开发者 https://www.devze.com 2023-03-17 05:05 出处:网络
I am converting C- code based program into Unicode visual studio 2008 on windows 7 64开发者_JS百科 it OS. I have converted all the non unicode function into unicode successfully. But only getting comp

I am converting C- code based program into Unicode visual studio 2008 on windows 7 64开发者_JS百科 it OS. I have converted all the non unicode function into unicode successfully. But only getting compiler error in some c- code based functions as given below:

struct ref_pages *rfl_scan_ref_list( short mode, short class, short element, _TCHAR **refdata )

In the above fuunction, class is defined as a variable parameter. When we will convert this function into Unicode saying:

error C2226: syntax error : unexpected type '<unnamed-tag>'
'class' : missing tag name

Anyone have any ideas?


You can't use "class" as a variable name. You're using a c++ compiler and "class" is a reserved keyword.


There is no error in the lines you posted.

Apparently you're not using a C compiler for your C code. Why? Use a C compiler for C code; a Pascal compiler for Pascal code; a Lisp compiler for Lisp code; etc ...

I believe Visual Studio has an option to make it a C compiler. You need to find that option and set it.


As others have indicated, you're using a C++ compiler and class is a reserved keyword in C++. To force VS2008 to act as C compiler, right click on your project name, select Properties. Then browse to Configuration Properties -> C/C++ -> Advanced and then change the Compile As option to Compile as C Code.


class is a reserved keyword in C++. you should use another variable name.

0

精彩评论

暂无评论...
验证码 换一张
取 消