• ベストアンサー

ubuntuにxspimをインストールできません

Linux始めたばかりの初心者です。ディストリビューションはubuntuを使っています。 授業に使っているXSPIMというソフトを自宅のLinuxにも入れようとしています。XSPIMというのはUNIX環境で動くアセンブリ言語のシミュレータです。インストール手順がここ(http://www.cs.wisc.edu/~larus/spim.html) の下の方に載っているのでそれに従っているのですが・・・ 現在手順6.で躓いています、、 6. Then, if you are using Imakefile file, change to the spim-7.2/xspim directory and type: % xmkmf % make If you do not have a copy of xmkmf, you can use the Makefile in the xspim directory, but beware that it may not work on your system because the paths to the X windows libraries could be different. 上記の通りに、spim-7.3/xspimのディレクトリに移動して、xmkmfを実行しようとすると、次のエラーが出てしまいます。 mv -f Makefile Makefile.bak imake -DUseInstalled -I/usr/lib/X11/config <stdin>:1:19: error: stdio.h: No such file or directory <stdin>:2:19: error: ctype.h: No such file or directory <stdin>: In function ‘main’: <stdin>:18: error: ‘NULL’ undeclared (first use in this function) <stdin>:18: error: (Each undeclared identifier is reported only once <stdin>:18: error: for each function it appears in.) <stdin>:45: warning: incompatible implicit declaration of built-in function ‘sscanf’ <stdin>:49: warning: incompatible implicit declaration of built-in function ‘printf’ Aborted (core dumped) 何か余分にインストールしなければならないものがあるんでしょうか? エラーメッセージを見ても何がいけないのか僕ではわからなかったのでここに投稿させていただきました。 よろしくお願いします。

質問者が選んだベストアンサー

  • ベストアンサー
  • xjd
  • ベストアンサー率63% (1021/1612)
回答No.1

こんばんは。 自宅の、ubuntu-Ja-6.10 に xspim をインストールしてみましたが 正常に起動しました。(動作確認まではしてませんけど) > <stdin>:1:19: error: stdio.h: No such file or directory > <stdin>:2:19: error: ctype.h: No such file or directory stdio.h と ctype.h が見つかりません、と出てますので /usr/include/ 配下にこれらのファイルがあるか確認してください。 ファイルが無い場合は、パッケージ libc6-dev をインストールしてください。 stdio.h ctype.h は libc6-devパッケージに含まれています。 最新のパッケージ一覧をダウンロード # apt-get update パッケージを検索 # apt-cache search libc6 libc6 - GNU C Library: Shared libraries and Timezone data libc6-dbg - GNU C Library: Libraries with debugging symbols libc6-dev - GNU C Library: Development Libraries and Header Files libc6-devパッケージをインストール # apt-get install libc6-dev あなたのubuntuのインストール方法によっては、他にも、 bison flex xlibs-dev libxaw7-dev あたりのパッケージが必要になるかもしれません。 コンパイル中に、まだファイルが無いエラーが出るようでしたら、必要なパッケージを 調べてインストールしてください。

TAK81306
質問者

お礼

素早い解答感謝します! xjdさんのおっしゃるとおり、libc6-devパッケージがインストールされていなかったようなので、早速インストールしてみたところ、xmkmfコマンドが正常に動きました!ありがとうございました! 続いてmakeコマンドも実行してみました。やたらと長いメッセージが表示された後、ディレクトリを見ると色々ファイルが作成されていました。 手順8.を試してみたのですが 8.   To run spim or xspim, the exception handler must be installed in the directory specified by the variable EXCEPTION_DIR in the Makefile. If the file exception.s is not installed, spim and xspim fail before they start running. You can either install this file by hand or by typing % make install which also installs spim or xspim, and the manual pages in the directories that you set (above). すると次のようなメッセージが・・・ install -c xspim /home/takumi/spim-7.3/xspim/xspim install: `xspim' と `/home/takumi/spim-7.3/xspim/xspim' は同じファイルです make: *** [install] エラー 1 同じファイルというのはなんとなくわかりますが・・・何を変更すればいいのか分かりません。現在ImakefileのEXCEPTION_DIR, BIN_DIR, MAN_DIRを全て/home/takumi/spim-7.3/xspim/で統一してあるのですが、変更した方がいいと言うことなんでしょうか?

その他の回答 (2)

  • xjd
  • ベストアンサー率63% (1021/1612)
回答No.3

こんばんは。 >現在ImakefileのEXCEPTION_DIR, BIN_DIR, MAN_DIRを全て >/home/takumi/spim-7.3/xspim/で統一してあるのですが >変更した方がいいと言うことなんでしょうか? 無理にインストール先を変更する必要は無いと思いますが。 フリーソフトのインストール先は、/usr/local 配下が多いです。 Imakefileのデフォルトも、 BIN_DIR = /usr/local/bin EXCEPTION_DIR = /usr/local/lib MAN_DIR = /usr/man/man となっています。 私の手順はこんな感じです。 $ xmkmf $ make $ su Password: # make install # exit $ ls /usr/local/bin/ ./ ../ xspim あとはコマンドを実行するだけ $ /usr/local/bin/xspim (/usr/local/bin にパスが通っていれば、xspim だけでよい)

TAK81306
質問者

お礼

>フリーソフトのインストール先は、/usr/local 配下が多いです そうなんですか・・・覚えておきます。 無理にImakefileをいじる必要はなかったんですね。。 お蔭様でインストールできました、本当に御世話になりました!

  • mac_res
  • ベストアンサー率36% (568/1571)
回答No.2

ソースも/home/takumi/spim-7.3/xspim/においてありませんか? Install dirとsource dirは少なくとも別にする必要があります。 自分のマシンでしたら、/home/takumi/spim-7.3/xspim/に固めてinstallするより、/usr/local/bin, /usr/local/manにinstallしたほうが使いやすいと思います。

TAK81306
質問者

お礼

mac_resさんのおっしゃるとおり、 Imakefileの中のインストール先を変更せずに % make install を実行してみましたところ、無事にインストールできました! 手順9.の % make test も"Passed All tests"と出ました。 % xspim で実行してみたところ、無事に立ちあがりました! http://blog50.fc2.com/t/takumification/file/xspimSS.png 本当にありがとうございました!

関連するQ&A

  • Linuxでプログラミング

    Windows7でVirtualBoxを利用してLinuxを使っています。 そのLinuxでC言語のプログラムをgccでコンパイルしたのですが、 error: stdio.h:No such file or directory In function main': 警告:incompatible implicit declaration of built-in function printf' と表示されます。プログラムは以下のような内容です。 #include<stdio.h> int main(void) { printf("hello,world\n"); return 0; } なぜエラーになってしまうのか分かりません。どうしたらよいのでしょうか? 他に何か必要な情報があれば答えます。よろしくお願いします。

  • avr studioのビルドエラーについて

    avr studio 6にてプログラミングしようとしている超初心者です 書き込み機器をmkII、atmega328pに書き込もうとしております しかし、エラーが出てしまい、どうしてもビルドが成功できません。 質問なのですが、こちらのサイト(http://www.diotown.com/creative/2011/05/arduino-de-pwm-controller.h...)にて行っているものを そのままプログラミングしてみようと リンクについていたソース(http://www006.upp.so-net.ne.jp/neueziel/pp/powerpack_r.txt) を #include <avr/io.h>からコピーしてビルドしてみました。 ですが、ビルドがエラー15個、警告5個出てしまいました。 そのうちの数か所を記載しますのでどうすればよいかアドバイスよろしくお願いします。 説明 行 列 プロジェクト (1)エラー 1 unknown type name 'byte' 190 1 VVVF (2)エラー 5 'OUTPUT' undeclared (first use in this function) 291 17 VVVF (3)エラー 9 'HIGH' undeclared (first use in this function) 330 20 VVVF (4)エラー 12 'word' undeclared (first use in this function) 582 26 VVVF (5)エラー 13 expected ';' before 'light' 582 31 VVVF (6)エラー 14 'B00010001' undeclared (first use in this function) 583 14 VVVF (7)警告 4 implicit declaration of function 'pinMode' [-Wimplicit-function-declaration]291 2 VVVF (8)警告 7 implicit declaration of function 'swrite' [-Wimplicit-function-declaration]327 4 VVVF (9)警告 8 implicit declaration of function 'digitalWrite' [-Wimplicit-function-declaration]330 3 VVVF (10)警告 10 implicit declaration of function 'delay' [-Wimplicit-function-declaration] 332 3 VVVF (11)警告 11 implicit declaration of function 'analogRead' [-Wimplicit-function-declaration]344 4 VVVF 以上ですよろしくお願いします

  • 今、「Aircrack」というフリーのハッキングソフトを、Ubuntu

    今、「Aircrack」というフリーのハッキングソフトを、Ubuntuにいれたのはいいのですが、 makeとコマンドを打つと、エラーがでます。 エラー内容は下記のとおりです。 mizuo@mizuo-laptop:~/ダウンロード/aircrack-ng-1.0$ sudo make [sudo] password for mizuo: make -C src all make[1]: ディレクトリ `/home/mizuo/ダウンロード/aircrack-ng-1.0/src' に入ります make -C osdep make[2]: ディレクトリ `/home/mizuo/ダウンロード/aircrack-ng-1.0/src/osdep' に入ります Building for Linux make[3]: ディレクトリ `/home/mizuo/ダウンロード/aircrack-ng-1.0/src/osdep' に入ります make[3]: `.os.Linux' は更新済みです make[3]: ディレクトリ `/home/mizuo/ダウンロード/aircrack-ng-1.0/src/osdep' から出ます make[2]: ディレクトリ `/home/mizuo/ダウンロード/aircrack-ng-1.0/src/osdep' から出ます gcc -g -W -Wall -Werror -O3 -D_FILE_OFFSET_BITS=64 -D_REVISION=0 -Iinclude -c -o aircrack-ng.o aircrack-ng.c In file included from aircrack-ng.c:65: crypto.h:12:26: error: openssl/hmac.h: No such file or directory crypto.h:13:25: error: openssl/sha.h: No such file or directory crypto.h:15:25: error: openssl/rc4.h: No such file or directory crypto.h:16:25: error: openssl/aes.h: No such file or directory cc1: warnings being treated as errors In file included from aircrack-ng.c:69: sha1-sse2.h: In function ‘calc_4pmk’: sha1-sse2.h:140: error: implicit declaration of function ‘HMAC’ sha1-sse2.h:140: error: implicit declaration of function ‘EVP_sha1’ aircrack-ng.c: In function ‘crack_wpa_thread’: aircrack-ng.c:3910: error: implicit declaration of function ‘EVP_md5’ make[1]: *** [aircrack-ng.o] エラー 1 make[1]: ディレクトリ `/home/mizuo/ダウンロード/aircrack-ng-1.0/src' から出ます make: *** [all] エラー 2 mizuo@mizuo-laptop:~/ダウンロード/aircrack-ng-1.0$ このエラーがどうしてでているのかお分かりの方、正常に使うにはどうしたらいいのでしょうか?? よろしくお願いします。

  • mod_limitipconnのインストールでapxsのコンパイルエラー

    お世話になります。 環境-------------------- Redhat Linux Fedora 5 Apache/2.2.2 ------------------------ mod_limitipconnをインストールしたいのですが、 makeするとapxsのコンパイルエラーが起こりインストールできずにいます。 エラー内容は以下の通りです。 ------------------------ [root@www mod_limitipconn-0.04]# make apxs -c mod_limitipconn.c /usr/lib/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/include/httpd -I/usr/include/apr-1 -I/usr/include/apr-1 -c -o mod_limitipconn.lo mod_limitipconn.c && touch mod_limitipconn.slo mod_limitipconn.c:39: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'limitipconn_module' mod_limitipconn.c:43: error: expected specifier-qualifier-list before 'array_header' mod_limitipconn.c:49: error: expected ')' before '*' token mod_limitipconn.c: In function 'limitipconn_handler': --中略-- mod_limitipconn.c:176: warning: implicit declaration of function 'ap_log_reason' mod_limitipconn.c:178: warning: implicit declaration of function 'ap_table_setn' mod_limitipconn.c: In function 'no_limit_config_cmd': mod_limitipconn.c:208: warning: implicit declaration of function 'ap_push_array' mod_limitipconn.c:208: error: 'limitipconn_dir_config' has no member named 'no_limit' mod_limitipconn.c:208: warning: implicit declaration of function 'ap_pstrdup' mod_limitipconn.c:208: warning: assignment makes pointer from integer without a cast mod_limitipconn.c: In function 'excl_limit_config_cmd': mod_limitipconn.c:218: error: 'limitipconn_dir_config' has no member named 'excl_limit' mod_limitipconn.c:218: warning: assignment makes pointer from integer without a cast mod_limitipconn.c: At top level: mod_limitipconn.c:224: warning: missing braces around initializer mod_limitipconn.c:224: warning: (near initialization for 'limitipconn_cmds[0].func') mod_limitipconn.c:224: warning: initialization from incompatible pointer type mod_limitipconn.c:226: warning: initialization from incompatible pointer type mod_limitipconn.c:228: warning: initialization from incompatible pointer type mod_limitipconn.c:234: error: expected declaration specifiers or '...' before 'pool' mod_limitipconn.c: In function 'limitipconn_init': mod_limitipconn.c:236: warning: passing argument 4 of 'ap_log_error' makes integer from pointer without a cast mod_limitipconn.c:236: warning: passing argument 5 of 'ap_log_error' from incompatible pointer type mod_limitipconn.c:236: error: too few arguments to function 'ap_log_error' mod_limitipconn.c: At top level: mod_limitipconn.c:239: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'limitipconn_module' apxs:Error: Command failed with rc=65536 . make: *** [mod_limitipconn.so] Error 1 ------------- apache は DSOをサポートしています。 (httpd -l | grep mod_so.c で確認) どうぞ宜しくお願いいたします。

  • GPIBドライバIC uPD7210を使用したGPIBカードをFreeBSD7.0(?)で使用するには?

    GPIBドライバIC uPD7210を使用したGPIBカードをFreeBSD7.0(?)で使用するためにネットにあったものを参考に、カーネルを再構築してmakeを実行したところ、errorがたくさん出て困っています。他サイトでも同じ質問をしたのですがあまり回答がないのでこちらでも質問します。 とりあえずネットに書いてあることをそのままやってみてerrorメッセージがなくなるようにいろいろ調べて試しているのですが一向にうまくいきません。どなたかアドバイスをお願いします。卒研で先生にやらされているのですがC言語を授業で少しやったことがある程度なので知識は限りなく乏しいです。しかし、今さらテーマを変えるわけにもいかないのでなんとかしたいのです。 デバイスドライバ等は下記アドレスにあります。 http://www.youko-house.ne.jp/~hirohito/soft/upd7210-2 ver.4.xではうまくいくそうです。目的はgpibを使った計測システム作成なので、最悪ver4を使おうと思うのですがそれでは何もやっていないのとほぼ同じなのでver.7になんとかつっこめないかと思っています。 あとメジャー番号の振り分けも必要なみたいなのですがver.4の場合、/usr/src/sys/conf/majorsに一覧になっているのですがver.7ではmajorsがなくなっていてどこかにあるのかわかりません。 下にエラーメッセージを示します。warningは先生が無視してもいいといったので(ホントかわかりませんが)とりあえずerror:だけ示します。すべてupd7210.cのものです。 78: error: 'nopoll' undeclared here (not in a function) 79: error: 'nommap' undeclared here (not in a function) 80: error: 'nostrategy' undeclared here (not in a function) 83: error: 'nodump' undeclared here (not in a function) 84: error: 'nopsize' undeclared here (not in a function) 134: error: conflicting types for 'gpib_open' 65: error: previous declaration of 'gpib_open' was here In function 'gpib_open': At top level: 160: error: conflicting types for 'gpib_close' 66: error: previous declaration of 'gpib_close' was here In function 'gpib_close': At top level: 187: error: conflicting types for 'gpib_read' 67: error: previous declaration of 'gpib_read' was here In function 'gpib_read': At top level: 254: error: conflicting types for 'gpib_write' 68: error: previous declaration of 'gpib_write' was here In function 'gpib_write': At top level: 314: error: conflicting types for 'gpib_ioctl' 69: error: previous declaration of 'gpib_ioctl' was here In function 'gpib_ioctl': 377: error: label at end of compound statement

  • ubuntuでのコンパイル

    Linux超初心者です。 今回困っていることはubutuでコンパイルができないことです。 ubuntuのバージョンは7.10 Gutsy Gibbonです。 教えてgooでも何個かそれに関する質問があったのですがそれを行ってもだめでした。 まず、ubuntuには開発環境が入っていないということでbuild-essentialをインストールしようとおもいました。 $ sudo apt-get install build-essential と入力したところ E: ロック /var/lib/dpkg/lock が取得できませんでした - open (11 Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it? と返ってきてインストールできませんでした。 一応GUI画面でもやっとこうと思いでやりましたがSynapticに検索にすら引っかからず。。。 それで今度はubuntuに関するサイトからbuild-essentialのインストーラーをミラーサイトからダウンロードしてインストールを行ったのですが Error:Dependency is not satisfible: libc6-dev|libc-dev というエラーメッセージがでてまた無理でした。 それでそのエラーメッセージにあるlibc6-devをインストールしないといけないのかと思い。これも行ってみました。 ~$ sudo apt-get install libc E: ロック /var/lib/dpkg/lock が取得できませんでした - open (11 Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it? とまた同じエラー $ sudo apt-get install libc6 E: ロック /var/lib/dpkg/lock が取得できませんでした - open (11 Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it? こちらも同じエラー。 よくわからないですがwhichというコマンドもためしておきました。 ~$ which gcc /usr/bin/gcc ディレクトリ指定されるって事はコンパイラ入ってるのかと思い、試しにhello worldをコンパイルしてみましたが、 $ gcc hello.c hello.c:6:19: error: stdio.h: No such file or directory hello.c: In function ‘main’: hello.c:10: 警告: incompatible implicit declaration of built-in function ‘printf’ だめでした。 書いてる情報が少なかったらごめんなさい。 とりあえず困っているのでよろしくお願いします。

  • mallocで引数に変数を入れると警告がでます

    #include<stdio.h> int main(void){ int n,i; int* array; puts("n=?"); scanf("%d",&n); array = (int*)malloc(sizeof(int) * n); for(i=0;i<n;i++) *(array+i) = i; for(i=0;i<n;i++) printf("%d ",*(array+i)); puts(""); return 0; } C言語で、上述のプログラムをコンパイルしたところ、 9: warning: incompatible implicit declaration of built-in function ‘malloc’ と警告がでます。 ./a.outで普通に実行できるのですが、 警告がでるということは、もっと正しいやり方があるということでしょうか?

  • DBDのインストールで以下のエラー

    OSはmacOS 10.6 Snow Leopardです。 【1】まずディレクトリを移動 $cd/Users/machidaakira/Desktop/installlog/MySQL/DBD-mysql-3.0008 【2】perl Makefile.plI の実行で以下のエラー DBD-mysql-3.0008$ perl Makefile.plI will use the following settings for compiling and testing: cflags (mysql_config) = -I/usr/include/mysql -fno-omit-frame-pointer -pipe embedded (mysql_config) = libs (mysql_config) = -pipe -L/usr/lib/mysql -lmysqlclient -lz -lm mysql_config (guessed ) = mysql_config nocatchstderr (default ) = 0 nofoundrows (default ) = 0 ssl (guessed ) = 0 testdb (default ) = test testhost (default ) = testpassword (default ) = testsocket (default ) = testuser (default ) = To change these settings, see 'perl Makefile.PL --help' and 'perldoc INSTALL'. Failed to create t/mysql.mtest: Permission denied at Makefile.pl line 188, <PIPE> line 103. 【3】さらにmakeの実行で以下のエラー akiram1979:DBD-mysql-3.0008 machidaakira$ makegcc-4.2 -c -I/Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBI -I/usr/local/mysql/include/mysql -DDBD_MYSQL_WITH_SSL -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -arch x86_64 -arch i386 -arch ppc -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -I/usr/local/include -Os -DVERSION=\"3.0008\" -DXS_VERSION=\"3.0008\" "-I/System/Library/Perl/5.10.0/darwin-thread-multi-2level/CORE" dbdimp.c In file included from dbdimp.c:20: dbdimp.h:21:49: error: mysql.h: No such file or directory dbdimp.h:22:45: error: mysqld_error.h: No such file or directory dbdimp.h:23:49: error: errmsg.h: No such file or directory In file included from dbdimp.c:20: dbdimp.h:124: error: expected specifier-qualifier-list before ‘MYSQL’ dbdimp.h:214: error: expected specifier-qualifier-list before ‘MYSQL_RES’ In file included from dbdimp.c:20: dbdimp.h:268: error: expected ‘)’ before ‘*’ token dbdimp.h:271: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘mysql_st_internal_execute’ dbdimp.h:292: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token dbdimp.c: In function ‘alloc_param’: dbdimp.c:112: warning: format not a string literal and no format arguments dbdimp.c: At top level: dbdimp.c:398: error: expected ‘)’ before ‘*’ token dbdimp.c:666: error: ‘FIELD_TYPE_VAR_STRING’ undeclared here (not in a function) dbdimp.c:673: error: ‘FIELD_TYPE_DECIMAL’ undeclared here (not in a function) dbdimp.c:680: error: ‘FIELD_TYPE_TINY’ undeclared here (not in a function) dbdimp.c:687: error: ‘FIELD_TYPE_SHORT’ undeclared here (not in a function) dbdimp.c:694: error: ‘FIELD_TYPE_LONG’ undeclared here (not in a function) dbdimp.c:701: error: ‘FIELD_TYPE_FLOAT’ undeclared here (not in a ~ dbdimp.c:3978: error: ‘imp_dbh_t’ has no member named ‘mysql’ dbdimp.c: In function ‘mysql_db_last_insert_id’: dbdimp.c:3993: error: ‘imp_dbh_t’ has no member named ‘mysql’ dbdimp.c:3993: warning: passing argument 2 of ‘Perl_sv_2mortal’ makes pointer from integer without a cast lipo: can't open input file: /var/folders/bi/biS-GmuWG80l7P98UBgt0k+++TI/-Tmp-//ccspyro0.out (No such file or directory) make: *** [dbdimp.o] Error 1

  • 【c言語】ファイルの読み込みエラーについて

    自然言語処理について勉強しています。 Wikipediaのdumpデータからタイトルと本文を抜き出して処理をしようと思ってます。 xmlの処理について試しているのですが、エラーに見舞われて困っています。 プログラミングはあまり得意ではないです。 以下にソースコードとエラー部分を貼り付けます。 ご助力お願いします。 ============================ #include <stdlib.h> #include <string.h> int main (){ size_t p; char pb[5]; char line[BUFSIZ]; FILE *fp = fopen("//Wikipediaの分割ファイル//.xml", "r");//xmlファイルのアドレス char title[BUFSIZ]; //FILE *gt=fopen("list_1.txt","r"); FILE *fw = fopen("get_text_c.txt", "w"); if ((NULL == fp)||(NULL== fw )){ printf("aboooooooooooooooooooooooooooot") abort();//終了、ここがうまくいってない? } while (p = ftell(fp), fgets(line, BUFSIZ, fp)) { if (strstr(line, "<title>")){ pb[0] = p;//タイトルの始点 } else if (strstr(line, "</title>")){  pb[3]=p;//タイトルの終点   pb[2]=p-pb[0];//タイトルのバイト数  fprintf(fw, "%zu \t %zu \n", pb[2], pb[3]); //pb2とpb3の観察。  fgets(line,pb2[2],pb[0]);//タイトルを取得  printf("%s",line);//表示  fprintf(fw,"%s",line);//書き込み } else if (strstr(line, "</page>")) {  pb[1] = p - pb[0];  //fwrite(pb, sizeof(size_t), 2, fw); // ...  fprintf(fw, "%zu \t %zu \n", pb[0], pb[1]); //... テキスト形式で観察可能 } } } fclose(fw); fclose(fp); } エラー(ファイル名は get_うぃき.c としてます。) =========================== get_うぃき.c:10:16: warning: declaration of built-in function 'fopen' requires inclusion of the header <stdio.h> [-Wbuiltin-requires-header] get_うぃき.c:11:16: error: use of undeclared identifier 'BUFSIZ' char title[BUFSIZ]; ^ get_うぃき.c:14:5: error: use of undeclared identifier 'FILE' FILE *fw = fopen("get_text_c.txt", "w"); ^ get_うぃき.c:14:11: error: use of undeclared identifier 'fw' FILE *fw = fopen("get_text_c.txt", "w"); ^ get_うぃき.c:15:18: error: use of undeclared identifier 'fp' if ((NULL == fp)||(NULL== fw )){ ^ get_うぃき.c:15:31: error: use of undeclared identifier 'fw' if ((NULL == fp)||(NULL== fw )){ ^ get_うぃき.c:16:13: warning: treating Unicode character <U+FF08> as identifier character rather than as '(' symbol [-Wunicode-homoglyph] printf("aboooooooooooooooooooooooooooot") ^~ get_うぃき.c:16:7: error: use of undeclared identifier 'printf(' printf("aboooooooooooooooooooooooooooot") ^ get_うぃき.c:16:49: warning: treating Unicode character <U+FF09> as identifier character rather than as ')' symbol [-Wunicode-homoglyph] printf("aboooooooooooooooooooooooooooot") ^~ get_うぃき.c:20:16: error: implicit declaration of function 'ftell' is invalid in C99 [-Werror,-Wimplicit-function-declaration] while (p = ftell(fp), fgets(line, BUFSIZ, fp)) { ^ get_うぃき.c:20:27: error: implicit declaration of function 'fgets' is invalid in C99 [-Werror,-Wimplicit-function-declaration] while (p = ftell(fp), fgets(line, BUFSIZ, fp)) { ^ get_うぃき.c:20:39: error: use of undeclared identifier 'BUFSIZ' while (p = ftell(fp), fgets(line, BUFSIZ, fp)) { ^ get_うぃき.c:20:47: error: use of undeclared identifier 'fp' while (p = ftell(fp), fgets(line, BUFSIZ, fp)) { ^ get_うぃき.c:20:12: error: use of undeclared identifier 'p' while (p = ftell(fp), fgets(line, BUFSIZ, fp)) { ^ get_うぃき.c:20:22: error: use of undeclared identifier 'fp' while (p = ftell(fp), fgets(line, BUFSIZ, fp)) { ^ get_うぃき.c:22:15: error: use of undeclared identifier 'p' pb[0] = p;//タイトルの始点 ^ get_うぃき.c:25:7: warning: treating Unicode character as whitespace [-Wunicode-whitespace]  pb[3]=p;//タイトルの終点 ^~ get_うぃき.c:26:6: warning: treating Unicode character as whitespace [-Wunicode-whitespace]   pb[2]=p-pb[0];//タイトルのバイト数 ^~ get_tokuhisa.c:25:16: error

  • MinGWとmsysでGTK+の開発環境を整えたい

    WindowsXP上で、コンパイラにMinGWを用いてGTK+2.0を用いたGUIアプリケーションの開発を行いたいと思っています。 しかし、GTK+2.0のサンプルソースのコンパイルが通りません。 コマンドとそのエラーは以下の通りです。 どうもヘッダーが見つからないと言っているようですが、ヘッダーをコンパイラのincludeフォルダに入れても駄目でした。 いれたGTK+はGlade等、全てがパックになっているものでした。インストール時にmsysを認識してくれていたので、勝手に設定をしてくれるのかと思ったのですが…。 $ gcc hello_gtk.c 'pkg-config gtk+-2.0 --cflags' hello_gtk.c:1:21: gtk/gtk.h: No such file or directory hello_gtk.c: In function `main': hello_gtk.c:5: error: `GtkWidget' undeclared (first use in this function) hello_gtk.c:5: error: (Each undeclared identifier is reported only once hello_gtk.c:5: error: for each function it appears in.) hello_gtk.c:5: error: `window' undeclared (first use in this function) hello_gtk.c:6: error: `label' undeclared (first use in this function) hello_gtk.c:10: error: `GTK_WINDOW_TOPLEVEL' undeclared (first use in this function) gcc.exe: pkg-config gtk+-2.0 --cflags: No such file or directory どうすれば、コンパイルできるようになるのでしょう?