2017-06-26 9 views
0
#include <stdio.h> 

int main() 

{ 

     printf("HelloWorld\n"); 

     return 0; 
} 

ビルドボタンをクリックすると、一連のエラーが表示されました。しかし、 は "stdio.h"の代わりに "stdlib.h"と置き換えても問題ありません。Stdio.h on VC++ 6.0

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 
+1

次の質問では、コードブロックを4つのスペースでインデントしてください(ここで簡単にコードを選択し、 'ctrl' +' k'を打つ)。 '<! - language:none - >'はコンソール出力ダンプにも便利です。あなたの編集を妨害して申し訳ありません、それは意図的ではありませんでした。 –

+0

実際にMSVC6.0を使用する魅力的な理由はありますか? –

+0

MSVC6.0は98年にリリースされました(ディレクトリ名が示すように)。ほとんどの管轄区域で飲み、投票するのに十分な年齢です。 –

答えて

1

C++コンパイラでCコードをコンパイルしようとしています。

これは、Visual Studio 6.0では、ソースファイルの名前を.cppではなく.cに変更することです。これはコンパイラをある種の "C"モードにします。

+2

年齢でVisual C++ 6を使用していませんが、これは問題のないヘッダーになるはずです。今私はいくつかのプリプロセッサがヘッダーファイルの構文を台無しにすることを定義する疑いがあります。 – Mario

+0

@Mario:これはどちらも確認できませんが、これはすべてメモリからのものですが、このコンパイラを使ってCコードをビルドする方法はこれまでにありました。 – Bathsheba

+0

すべてのバンドルされた標準ヘッダーには、適切なオプションの '#extern" C "'が付いています。また、いくつかのC/C++の競合がある場合は、構文ではなくリンクエラーとして表示される可能性が高くなります。 – Mario

関連する問題