C_jay
C_jay

Reputation: 11

Stdio.h on VC++6.0

#include <stdio.h>

int main()

{   

        printf("HelloWorld\n");

        return 0;
}

It appeared a series of errors when I clicked build button. But there is not any problem when i substituted "stdlib.h" for "stdio.h".

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(84) : error C2059: syntax error : ','

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(314) : error C2143: syntax error : missing '{' before '__cdecl'

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(314) : error C2143: syntax error : missing ')' before '*'

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(314) : error C2081: 'size_t' : name in formal parameter list illegal

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(314) : error C2081: 'size_t' : name in formal parameter list illegal

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(314) : error C2081: 'FILE' : name in formal parameter list illegal

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(314) : error C2143: syntax error : missing '{' before '*'

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(314) : error C2059: syntax error : ')'

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(314) : error C2059: syntax error : ';'

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(320) : error C2143: syntax error : missing '{' before '__cdecl'

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(320) : error C2143: syntax error : missing ')' before '*'

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(320) : error C2081: 'size_t' : name in formal parameter list illegal

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(320) : error C2081: 'size_t' : name in formal parameter list illegal

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(320) : error C2081: 'FILE' : name in formal parameter list illegal

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(320) : error C2143: syntax error : missing '{' before '*'

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(320) : error C2059: syntax error : ')'

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(320) : error C2059: syntax error : ';'

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(341) : error C2081: 'size_t' : name in formal parameter list illegal

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(342) : error C2059: syntax error : ','

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(342) : error C2143: syntax error : missing ')' before 'const'

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(342) : error C2081: 'size_t' : name in formal parameter list illegal

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(342) : error C2143: syntax error : missing '{' before 'const'

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(342) : error C2059: syntax error : ','

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(342) : error C2059: syntax error : ')'

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(352) : error C2059: syntax error : ','

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(352) : error C2143: syntax error : missing ')' before 'const'

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(352) : error C2081: 'size_t' : name in formal parameter list illegal

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(352) : error C2143: syntax error : missing '{' before 'const'

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(352) : error C2059: syntax error : ','

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(352) : error C2059: syntax error : ')'

d:\program files (x86)\vc++ 6.0\vc6.0\vc98\include\stdio.h(403) : fatal error C1003: error count exceeds 100; stopping compilation

Upvotes: 0

Views: 269

Answers (1)

Bathsheba
Bathsheba

Reputation: 234695

You are attempting to compile C code with a C++ compiler.

One way round this with Visual Studio 6.0 is to rename the source file to take a .c, rather than a .cpp extension. That puts the compiler into a sort of "C" mode.

Upvotes: 1

Related Questions