私はapacheモジュールをプログラミングしていました。プログラミングの途中でファイルを開いていましたが、コンパイル中にエラーが発生しました。
32. static int wqb_handler(request_rec* req){
33. // Open and read our requested file
34. const char* p_file = req->filename;
35.
36. FILE* req_file;
37. if((req_file = fopen(p_file,"r"))==NULL){
38. return HTTP_NOT_FOUND;
39. }else{
40. fclose(req_file);
41. }
42. // Required variables
43. const char* content_type_a = "text/html";
44.
45. // Set Headers
46. ap_set_content_type(req,content_type_a);
47. if(req->header_only){
48. return OK;
49. }
50.
51.
52. return OK;
53. }
問題はその関数にあり、それが問題であるかどうかを確認していました。問題はif-elseステートメントであり、コードはC++ではなくCで記述されていると思います。
これらはエラーです:
C:/wqb/wqb1_apache2.c(43) : error C2143: syntax error : missing ';' in front of 'const'
C:/wqb/wqb1_apache2.c(46) : error C2065: 'content_type_a' : undeclarated identifier