トップページ > 過去ログ > 記事閲覧
謎のエラーが大量に出ます。
名前:優柔不断 日時: 2007/08/27 15:15

以下のコードをコンパイルしようと思ったら、大量のエラーが出たのですが。なぜでしょうか。 以下ソースコード (handle.h) #ifndef GRAPH_OR_SOUND_H #define GRAPH_OR_SOUND_H #define GRAPH 1 #define SOUND 2 #define NOT_ERROR 0 #define NOT_OPENED 1 int MakeData(char *,int); class Graph{ int handle; //グラフィックハンドル int errorflag; //エラーフラグ char* gfilename;//ファイル名 public: Graph(); Graph(char *); int GraphHandle(); //グラフィックハンドルを返す int CheckError(); //エラーフラグを返す bool OpenGraph(char *); //グラフィックを初期化する(初期化されていたら失敗) bool Remake(char *); //別のグラフィックに変更する void GetFileName(char *);//ファイル名を返す void Close(); //グラフィックを空にする。 ~Graph(); } #endif (handle.cpp) #include "handle.h" #include "DxLib.h" #include<string.h> #include<stdio.h> int MakeData(char *filename,int mode) { FILE *file; fpos_t size; unsigned char *data; int i; int handle; file = fopen(filename,"rb"); if(file==NULL)return -1; fseek(file,0,SEEK_END); fgetpos(file,&size); data = (unsigned char *)malloc(size); if(data==NULL){ fclose(file); return -1; } rewind(file); fread(data,size,1,file); fclose(file); for(i=0;i<size;i++){ data[i] = ~data[i]; } if(mode==GRAPH){ handle=CreateGraphFromMem(data,size); }else if(mode==SOUND){ handle=LoadSoundMemByMemImage(data,size); } free(data); return handle; } Graph::Graph() { handle=0; errorflag=NOT_OPENED; gfilename=NULL; } Graph::Graph(char *filename) { errorflag=NOT_OPENED; gfilename=NULL; handle=MakeData(filename,GRAPH); if(handle==-1){ gfilename==NULL; }else{ gfilename=(char *)calloc(strlen(filename)+1,sizeof(char)); if(gfilename!=NULL){ strcpy(gfilename,filename); errorflag=NOT_ERROR; } } } int Graph::GraphHandle() { return handle; } int Graph::CheckError() { return errorflag; } bool Graph::OpenGraph(char *filename) { if(errorflag==NOT_ERROR){ return false; } handle=MakeData(filename,GRAPH); if(handle==-1){ errorflag=NOT_OPENED; return 0; } gfilename=(char *)calloc(strlen(filename)+1,sizeof(char)); if(gfilename==NULL){ DeleteGraph(handle); return false; } strcpy(gfilename,filename); errorflag=NOT_ERROR; return true; } bool Graph::Remake(char *filename) { int htemp; htemp=MakeData(filename,GRAPH); if(htemp==-1){ return false; } DeleteGraph(handle); handle=htemp; gfilename=(char *)realloc(gfilename,strlen(filename)+1); memset(gfilename,0,strlen(filename)+1); strcpy(gfilename,filename); return true; } void Graph::GetFileName(char *buf) { strcpy(buf,gfilename); return ; } void Graph::Close() { free(gfilename); gfilename=NULL; DeleteGraph(handle); errorflag=NOT_OPENED; return ; } Graph::~Graph() { DeleteGraph(handle); free(gfilename); gfilename=NULL; } そしてエラー内容は。↓ > C:\borland\bcc55\Bin\make.exe -fDebug\SleepWaintTimer.mak TARGET MAKE Version 5.2 Copyright (c) 1987, 2000 Borland bcc32 -W -3 -Od -w -AT -pc -H -k -Q -b- -v -y -DDEBUG -nDebug -IC:\programfile\Tools\DxLib_Bcc -c D:\program\SleepWaintTimer\handle.cpp Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland D:\program\SleepWaintTimer\handle.cpp: エラー E2040 c:\Borland\Bcc55\include\_stddef.h 36: 宣言が正しく終了していない + 詳細な解析情報 + D:\program\SleepWaintTimer\handle.cpp, line 1: #include D:\program\SleepWaintTimer\handle.h + D:\program\SleepWaintTimer\handle.cpp, line 2: #include D:\program\SleepWaintTimer\DxLib.h + D:\program\SleepWaintTimer\DxLib.h, line 40: #include c:\Borland\Bcc55\include\windows.h + c:\Borland\Bcc55\include\windows.h, line 130: #include c:\Borland\Bcc55\include\mem.h エラー E2090 c:\Borland\Bcc55\include\_stddef.h 132: 型限定子 'std' がクラス名または名前空間名ではない + 詳細な解析情報 + D:\program\SleepWaintTimer\handle.cpp, line 1: #include D:\program\SleepWaintTimer\handle.h + D:\program\SleepWaintTimer\handle.cpp, line 2: #include D:\program\SleepWaintTimer\DxLib.h + D:\program\SleepWaintTimer\DxLib.h, line 40: #include c:\Borland\Bcc55\include\windows.h + c:\Borland\Bcc55\include\windows.h, line 130: #include c:\Borland\Bcc55\include\mem.h エラー E2272 c:\Borland\Bcc55\include\_stddef.h 132: 識別子が必要 + 詳細な解析情報 + D:\program\SleepWaintTimer\handle.cpp, line 1: #include D:\program\SleepWaintTimer\handle.h + D:\program\SleepWaintTimer\handle.cpp, line 2: #include D:\program\SleepWaintTimer\DxLib.h + D:\program\SleepWaintTimer\DxLib.h, line 40: #include c:\Borland\Bcc55\include\windows.h + c:\Borland\Bcc55\include\windows.h, line 130: #include c:\Borland\Bcc55\include\mem.h エラー E2090 c:\Borland\Bcc55\include\_stddef.h 133: 型限定子 'std' がクラス名または名前空間名ではない + 詳細な解析情報 + D:\program\SleepWaintTimer\handle.cpp, line 1: #include D:\program\SleepWaintTimer\handle.h + D:\program\SleepWaintTimer\handle.cpp, line 2: #include D:\program\SleepWaintTimer\DxLib.h + D:\program\SleepWaintTimer\DxLib.h, line 40: #include c:\Borland\Bcc55\include\windows.h + c:\Borland\Bcc55\include\windows.h, line 130: #include c:\Borland\Bcc55\include\mem.h エラー E2272 c:\Borland\Bcc55\include\_stddef.h 133: 識別子が必要 + 詳細な解析情報 + D:\program\SleepWaintTimer\handle.cpp, line 1: #include D:\program\SleepWaintTimer\handle.h + D:\program\SleepWaintTimer\handle.cpp, line 2: #include D:\program\SleepWaintTimer\DxLib.h + D:\program\SleepWaintTimer\DxLib.h, line 40: #include c:\Borland\Bcc55\include\windows.h + c:\Borland\Bcc55\include\windows.h, line 130: #include c:\Borland\Bcc55\include\mem.h エラー E2090 c:\Borland\Bcc55\include\_stddef.h 134: 型限定子 'std' がクラス名または名前空間名ではない + 詳細な解析情報 + D:\program\SleepWaintTimer\handle.cpp, line 1: #include D:\program\SleepWaintTimer\handle.h + D:\program\SleepWaintTimer\handle.cpp, line 2: #include D:\program\SleepWaintTimer\DxLib.h + D:\program\SleepWaintTimer\DxLib.h, line 40: #include c:\Borland\Bcc55\include\windows.h + c:\Borland\Bcc55\include\windows.h, line 130: #include c:\Borland\Bcc55\include\mem.h エラー E2272 c:\Borland\Bcc55\include\_stddef.h 134: 識別子が必要 + 詳細な解析情報 + D:\program\SleepWaintTimer\handle.cpp, line 1: #include D:\program\SleepWaintTimer\handle.h + D:\program\SleepWaintTimer\handle.cpp, line 2: #include D:\program\SleepWaintTimer\DxLib.h + D:\program\SleepWaintTimer\DxLib.h, line 40: #include c:\Borland\Bcc55\include\windows.h + c:\Borland\Bcc55\include\windows.h, line 130: #include c:\Borland\Bcc55\include\mem.h エラー E2090 c:\Borland\Bcc55\include\_stddef.h 135: 型限定子 'std' がクラス名または名前空間名ではない + 詳細な解析情報 + D:\program\SleepWaintTimer\handle.cpp, line 1: #include D:\program\SleepWaintTimer\handle.h + D:\program\SleepWaintTimer\handle.cpp, line 2: #include D:\program\SleepWaintTimer\DxLib.h + D:\program\SleepWaintTimer\DxLib.h, line 40: #include c:\Borland\Bcc55\include\windows.h + c:\Borland\Bcc55\include\windows.h, line 130: #include c:\Borland\Bcc55\include\mem.h エラー E2272 c:\Borland\Bcc55\include\_stddef.h 135: 識別子が必要 + 詳細な解析情報 + D:\program\SleepWaintTimer\handle.cpp, line 1: #include D:\program\SleepWaintTimer\handle.h + D:\program\SleepWaintTimer\handle.cpp, line 2: #include D:\program\SleepWaintTimer\DxLib.h + D:\program\SleepWaintTimer\DxLib.h, line 40: #include c:\Borland\Bcc55\include\windows.h + c:\Borland\Bcc55\include\windows.h, line 130: #include c:\Borland\Bcc55\include\mem.h エラー E2188 c:\Borland\Bcc55\include\mem.h 39: 式の構文エラー + 詳細な解析情報 + D:\program\SleepWaintTimer\handle.cpp, line 1: #include D:\program\SleepWaintTimer\handle.h + D:\program\SleepWaintTimer\handle.cpp, line 2: #include D:\program\SleepWaintTimer\DxLib.h + D:\program\SleepWaintTimer\DxLib.h, line 40: #include c:\Borland\Bcc55\include\windows.h エラー E2293 c:\Borland\Bcc55\include\mem.h 39: ) が必要 + 詳細な解析情報 + D:\program\SleepWaintTimer\handle.cpp, line 1: #include D:\program\SleepWaintTimer\handle.h + D:\program\SleepWaintTimer\handle.cpp, line 2: #include D:\program\SleepWaintTimer\DxLib.h + D:\program\SleepWaintTimer\DxLib.h, line 40: #include c:\Borland\Bcc55\include\windows.h エラー E2188 c:\Borland\Bcc55\include\mem.h 40: 式の構文エラー + 詳細な解析情報 + D:\program\SleepWaintTimer\handle.cpp, line 1: #include D:\program\SleepWaintTimer\handle.h + D:\program\SleepWaintTimer\handle.cpp, line 2: #include D:\program\SleepWaintTimer\DxLib.h + D:\program\SleepWaintTimer\DxLib.h, line 40: #include c:\Borland\Bcc55\include\windows.h エラー E2293 c:\Borland\Bcc55\include\mem.h 40: ) が必要 + 詳細な解析情報 + D:\program\SleepWaintTimer\handle.cpp, line 1: #include D:\program\SleepWaintTimer\handle.h + D:\program\SleepWaintTimer\handle.cpp, line 2: #include D:\program\SleepWaintTimer\DxLib.h + D:\program\SleepWaintTimer\DxLib.h, line 40: #include c:\Borland\Bcc55\include\windows.h エラー E2188 c:\Borland\Bcc55\include\mem.h 41: 式の構文エラー + 詳細な解析情報 + D:\program\SleepWaintTimer\handle.cpp, line 1: #include D:\program\SleepWaintTimer\handle.h + D:\program\SleepWaintTimer\handle.cpp, line 2: #include D:\program\SleepWaintTimer\DxLib.h + D:\program\SleepWaintTimer\DxLib.h, line 40: #include c:\Borland\Bcc55\include\windows.h エラー E2293 c:\Borland\Bcc55\include\mem.h 41: ) が必要 + 詳細な解析情報 + D:\program\SleepWaintTimer\handle.cpp, line 1: #include D:\program\SleepWaintTimer\handle.h + D:\program\SleepWaintTimer\handle.cpp, line 2: #include D:\program\SleepWaintTimer\DxLib.h + D:\program\SleepWaintTimer\DxLib.h, line 40: #include c:\Borland\Bcc55\include\windows.h エラー E2188 c:\Borland\Bcc55\include\mem.h 42: 式の構文エラー + 詳細な解析情報 + D:\program\SleepWaintTimer\handle.cpp, line 1: #include D:\program\SleepWaintTimer\handle.h + D:\program\SleepWaintTimer\handle.cpp, line 2: #include D:\program\SleepWaintTimer\DxLib.h + D:\program\SleepWaintTimer\DxLib.h, line 40: #include c:\Borland\Bcc55\include\windows.h エラー E2293 c:\Borland\Bcc55\include\mem.h 42: ) が必要 + 詳細な解析情報 + D:\program\SleepWaintTimer\handle.cpp, line 1: #include D:\program\SleepWaintTimer\handle.h + D:\program\SleepWaintTimer\handle.cpp, line 2: #include D:\program\SleepWaintTimer\DxLib.h + D:\program\SleepWaintTimer\DxLib.h, line 40: #include c:\Borland\Bcc55\include\windows.h エラー E2316 c:\Borland\Bcc55\include\mem.h 49: 'size_t' は 'std' のメンバーではない + 詳細な解析情報 + D:\program\SleepWaintTimer\handle.cpp, line 1: #include D:\program\SleepWaintTimer\handle.h + D:\program\SleepWaintTimer\handle.cpp, line 2: #include D:\program\SleepWaintTimer\DxLib.h + D:\program\SleepWaintTimer\DxLib.h, line 40: #include c:\Borland\Bcc55\include\windows.h + c:\Borland\Bcc55\include\mem.h, line 45: namespace std エラー E2188 c:\Borland\Bcc55\include\mem.h 48: 式の構文エラー + 詳細な解析情報 + D:\program\SleepWaintTimer\handle.cpp, line 1: #include D:\program\SleepWaintTimer\handle.h + D:\program\SleepWaintTimer\handle.cpp, line 2: #include D:\program\SleepWaintTimer\DxLib.h + D:\program\SleepWaintTimer\DxLib.h, line 40: #include c:\Borland\Bcc55\include\windows.h + c:\Borland\Bcc55\include\mem.h, line 45: namespace std エラー E2293 c:\Borland\Bcc55\include\mem.h 49: ) が必要 + 詳細な解析情報 + D:\program\SleepWaintTimer\handle.cpp, line 1: #include D:\program\SleepWaintTimer\handle.h + D:\program\SleepWaintTimer\handle.cpp, line 2: #include D:\program\SleepWaintTimer\DxLib.h + D:\program\SleepWaintTimer\DxLib.h, line 40: #include c:\Borland\Bcc55\include\windows.h + c:\Borland\Bcc55\include\mem.h, line 45: namespace std エラー E2316 c:\Borland\Bcc55\include\mem.h 51: 'size_t' は 'std' のメンバーではない + 詳細な解析情報 + D:\program\SleepWaintTimer\handle.cpp, line 1: #include D:\program\SleepWaintTimer\handle.h + D:\program\SleepWaintTimer\handle.cpp, line 2: #include D:\program\SleepWaintTimer\DxLib.h + D:\program\SleepWaintTimer\DxLib.h, line 40: #include c:\Borland\Bcc55\include\windows.h + c:\Borland\Bcc55\include\mem.h, line 45: namespace std エラー E2188 c:\Borland\Bcc55\include\mem.h 50: 式の構文エラー + 詳細な解析情報 + D:\program\SleepWaintTimer\handle.cpp, line 1: #include D:\program\SleepWaintTimer\handle.h + D:\program\SleepWaintTimer\handle.cpp, line 2: #include D:\program\SleepWaintTimer\DxLib.h + D:\program\SleepWaintTimer\DxLib.h, line 40: #include c:\Borland\Bcc55\include\windows.h + c:\Borland\Bcc55\include\mem.h, line 45: namespace std エラー E2293 c:\Borland\Bcc55\include\mem.h 51: ) が必要 + 詳細な解析情報 + D:\program\SleepWaintTimer\handle.cpp, line 1: #include D:\program\SleepWaintTimer\handle.h + D:\program\SleepWaintTimer\handle.cpp, line 2: #include D:\program\SleepWaintTimer\DxLib.h + D:\program\SleepWaintTimer\DxLib.h, line 40: #include c:\Borland\Bcc55\include\windows.h + c:\Borland\Bcc55\include\mem.h, line 45: namespace std エラー E2316 c:\Borland\Bcc55\include\mem.h 53: 'size_t' は 'std' のメンバーではない + 詳細な解析情報 + D:\program\SleepWaintTimer\handle.cpp, line 1: #include D:\program\SleepWaintTimer\handle.h + D:\program\SleepWaintTimer\handle.cpp, line 2: #include D:\program\SleepWaintTimer\DxLib.h + D:\program\SleepWaintTimer\DxLib.h, line 40: #include c:\Borland\Bcc55\include\windows.h + c:\Borland\Bcc55\include\mem.h, line 45: namespace std エラー E2188 c:\Borland\Bcc55\include\mem.h 52: 式の構文エラー + 詳細な解析情報 + D:\program\SleepWaintTimer\handle.cpp, line 1: #include D:\program\SleepWaintTimer\handle.h + D:\program\SleepWaintTimer\handle.cpp, line 2: #include D:\program\SleepWaintTimer\DxLib.h + D:\program\SleepWaintTimer\DxLib.h, line 40: #include c:\Borland\Bcc55\include\windows.h + c:\Borland\Bcc55\include\mem.h, line 45: namespace std エラー E2228 c:\Borland\Bcc55\include\mem.h 52: エラーあるいは警告が多すぎる *** 26 errors in Compile *** ** error 1 ** deleting Debug\handle.obj Make End !! (Elapsed time 0:00.656) とでたのですが、ヘッダーファイルに問題があるのかと調べてみたのですが、エラー報告されたヘッダーを includeしたプロジェクトに問題は起きなく、このプロジェクトでのみエラーが起きます。 なので標準ヘッダーには問題はないと思います。

Page: 1 |

Re: 謎のエラーが大量に出ます。 ( No.1 )
名前:A 日時:2007/08/27 15:48

 最初のクラス Graphの {}の最後のところに ; がありません。
Re: 謎のエラーが大量に出ます。 ( No.2 )
名前:優柔不断 日時:2007/08/27 16:21

ありがとうございました。

Page: 1 |