CGIへのコンパイルエラー
初めまして。プログラミング暦はほとんどありません。javaを少しかじった程度です。今回Ajaxへ挑戦しようと思い、
http://itpro.nikkeibp.co.jp/article/COLUMN/20060115/227278/?ST=nettech
の予測補完インタフェースを作成しよとしています。
環境はfedoracore5でXPからのputyからの遠隔です。
complete.cをcomplete.cgiへコンパイルするときに、
[root@localhost html]# gcc -Wall -O2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include complete.c -o complete.cgi -lglib-2.0 -lsary -lpthread
complete.c:1: error: stray ‘\357’ in program
complete.c:1: error: stray ‘\273’ in program
complete.c:1: error: stray ‘\277’ in program
complete.c:1: error: stray ‘#’ in program
complete.c:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token
In file included from complete.c:2:
/usr/include/string.h:39: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:43: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:52: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:59: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:62: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:66: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:88: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:96: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:102: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:109: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘strxfrm’
/usr/include/string.h:184: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘strcspn’
/usr/include/string.h:188: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘strspn’
/usr/include/string.h:242: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘strlen’
/usr/include/string.h:270: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:288: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:292: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:296: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:299: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:329: error: expected declaration specifiers or ‘...’ before ‘size_t’
In file included from /usr/include/string.h:417,
from complete.c:2:
/usr/include/bits/string2.h:969: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__strcspn_c1’
/usr/include/bits/string2.h:971: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__strcspn_c1’
/usr/include/bits/string2.h:979: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__strcspn_c2’
/usr/include/bits/string2.h:982: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__strcspn_c2’
/usr/include/bits/string2.h:991: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__strcspn_c3’
/usr/include/bits/string2.h:994: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__strcspn_c3’
とエラーがでます。どうしたらいいでしょうか?(文字数の関係で半分しか掲載できませんでした。)よろしくお願いいたします。
補足
同じファイルの下のほうに class ExpressionCell { /関数内は省略させていただきます/ }; template<class TC> class CellUtil { /関数内は省略させていただきます/ }; と二つとも定義していますが、typedefの前にプロトタイプ宣言しておかないといけないんでしょうか? 後その前にも下記のような警告が出ていましたが、友人にそれは無視してもいい部分だといわれていたので、書いていませんでした。 In file included from /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backwardstrstream:51, from Frame/GpAppTpl.h:79, from Creator.h:7, from CGpFrame.cpp:7: /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated. In file included from Creator.h:7, from CGpFrame.cpp:7: