Windows errors are strange,
I have one header file in which one structure is declared,
as
typedef struct {
key_t xyz;
——
}INFO;
For this When I compile using cl.exe I get following list of errors.
: error C2016: C requires that a struct or union has at least one member : error C2061: syntax error : identifier 'key_t' : error C2059: syntax error : '}'
Well I am doing Code migration from Unix system to Windows system so key_t is not known in windows.
It does not make sense for the
Compiler Error C2016
which says no closing single quotation mark. Scratching my head and going around with the error.
I do not see any mistake in struct declaration,
Solution – C requires that a struct or union has at least one member
Just add the declaration of key_t in same header file before structure declaration.
typedef int key_t;
And compile again you are done.
Number of View :10858Related posts:
Tags: link errors, linux, tips, unix to windows porting, Windows XP
This entry was posted on Tuesday, August 3rd, 2010 at 6:20 am and is filed under Unix2Win32_Porting. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
#1 written by Koby August 1st, 2019 at 19:32
Hi, I do think this is aan excellent web site.
I syumbledupon it 😉 I am ging to return yyet again since i
hhave bookmarked it. Money and freedom is the
best way to change, may yyou be rich and continue too guide other people.