• ベストアンサー

C言語

コンパイルしたときに /tmp/cceF11bH.o(.txet+0*1de):ln function 'hilbert.'0 : : undefined reference to 'hilbert' collect2 :ld はステータス1 で終了しました と表示されます。 どういう意味でしょうか?

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

  • ベストアンサー
  • keikan
  • ベストアンサー率42% (75/176)
回答No.3

hilbertという関数が定義されているヘッダーなどがincludeされていません。またはそのソース内に定義がありません。 そのソース内の記述ミスでもないのであれば、どこか(他のヘッダー等)に定義がありますので探してみてください。そのヘッダーをincludeできれば良いと思います。

gfgdhggddg
質問者

お礼

ありがとうございます。もう一度やり直してみます。

その他の回答 (2)

  • BLUEPIXY
  • ベストアンサー率50% (3003/5914)
回答No.2

よくわからないけど hilbertって変数あるいは、関数が、ちゃんと定義されていないので リンクができません というような意味じゃないですか

  • hitomura
  • ベストアンサー率48% (325/664)
回答No.1

すみませんが、使用しているコンパイラの名前・バージョンを教えてください。 というか、あなたの質問は、上の文を「コンパイラ・バージョンは?」と書くぐらいに省略しすぎです。

gfgdhggddg
質問者

補足

すみません。 REDHATLinux・ターミナルを使用しています。

関連するQ&A

  • プログラミングのコンパイルで・・・・・

    C言語でのコンパイルで /tmp/cckxNO3W.o(.text+0xce): In function `main': : undefined reference to `hukeisan' collect2: ld はステータス 1 で終了しました と出るのですがどうしたらいいですか。教えてください。

  • C言語の画像抽出

    C言語のプログラムをコンパイルした時に ”/tmp/cchzThVk.o: In function 'c_to_sh': 5.c:(.text+0x5b3): undefined reference to 'sqrt' 5.c:(.text+0x64e): undefined reference to 'atan2' collect2: Id は ステータス1で終了しました。” とメッセージが出るのですが、このメッセージが出たときはプログラムにミスがあるということなのでしょうか。教えてくださいお願いします。

  • c言語 コンパイルエラー

    以下webページに載っているC言語のプログラムをコンパイルした時に ”/tmp/cchzThVk.o: In function 'c_to_sh': 5.c:(.text+0x5b3): undefined reference to 'sqrt' 5.c:(.text+0x64e): undefined reference to 'atan2' collect2: Id は ステータス1で終了しました。” とメッセージが出るのですが、このメッセージが出たときはプログラムにミスがあるということなのでしょうか。教えてくださいお願いします。 http://plaza.rakuten.co.jp/dragonkkk

  • LinuxのgccのLIBパス? (類似質問)

    Linuxのgccで、LIBのパスを設定する方法が知りたいのですが、gccについて詳しい書籍やサイトがありましたら、教えてください。 例)gcc -I/usr/local/example/include test.c /tmp/ccOFpCBo.o(.text+0x26): In function `main': : undefined reference to `EXAMPLE_1' /tmp/ccOFpCBo.o(.text+0x37): In function `main': : undefined reference to `EXAMPLE_2' /tmp/ccOFpCBo.o(.text+0x48): In function `main': : undefined reference to `EXAMPLE_3' collect2: ld はステータス1で終了しました。 また、ldとはVC6++でいう LINKのことでしょうか?

  • C言語プログラムの質問なんですが、エラーが出てコンパイルできません。

    C言語プログラムの質問なんですが、エラーが出てコンパイルできません。 エラーメッセージ /tmp/ccGHoP41.o: In function `main': step1-7.c:(.text+0x39): undefined reference to `stringStdin' collect2: ld returned 1 exit status 何が間違ってるのか全くわからない状態です。 どなたかアドバイスお願いします!

  • PostgreSQLをC言語でアクセスしようと

    PostgreSQL 8.4.8 文書にのっているサンプルプログラムの 例 30-1. libpq サンプルプログラム 1 #include <stdio.h> #include <stdlib.h> #include "libpq-fe.h" ・・・・・・・・・・・・・ をコピペしてコンパイルしたところ次のようなエラーがでました # gcc sample.c /tmp/cctZBolQ.o: In function `exit_nicely': sample.c:(.text+0xd): undefined reference to `PQfinish' /tmp/cctZBolQ.o: In function `main': sample.c:(.text+0x4a): undefined reference to `PQconnectdb' sample.c:(.text+0x5a): undefined reference to `PQstatus' sample.c:(.text+0x6a): undefined reference to `PQerrorMessage' sample.c:(.text+0xa5): undefined reference to `PQexec' sample.c:(.text+0xb5): undefined reference to `PQresultStatus' sample.c:(.text+0xc6): undefined reference to `PQerrorMessage' sample.c:(.text+0xed): undefined reference to `PQclear' sample.c:(.text+0x105): undefined reference to `PQclear' sample.c:(.text+0x119): undefined reference to `PQexec' sample.c:(.text+0x129): undefined reference to `PQresultStatus' sample.c:(.text+0x13a): undefined reference to `PQerrorMessage' sample.c:(.text+0x161): undefined reference to `PQclear' sample.c:(.text+0x179): undefined reference to `PQclear' sample.c:(.text+0x18d): undefined reference to `PQexec' sample.c:(.text+0x19d): undefined reference to `PQresultStatus' sample.c:(.text+0x1ae): undefined reference to `PQerrorMessage' sample.c:(.text+0x1d5): undefined reference to `PQclear' sample.c:(.text+0x1ed): undefined reference to `PQnfields' sample.c:(.text+0x20f): undefined reference to `PQfname' sample.c:(.text+0x26b): undefined reference to `PQgetvalue' sample.c:(.text+0x2a8): undefined reference to `PQntuples' sample.c:(.text+0x2ba): undefined reference to `PQclear' sample.c:(.text+0x2ce): undefined reference to `PQexec' sample.c:(.text+0x2de): undefined reference to `PQclear' sample.c:(.text+0x2f2): undefined reference to `PQexec' sample.c:(.text+0x302): undefined reference to `PQclear' sample.c:(.text+0x30e): undefined reference to `PQfinish' collect2: ld はステータス 1 で終了しました # # find /usr/include/ -name libpq*.h /usr/include/pgsql/internal/libpq-int.h /usr/include/pgsql/server/libpq/libpq-be.h /usr/include/pgsql/server/libpq/libpq.h /usr/include/pgsql/server/libpq/libpq-fs.h /usr/include/libpq/libpq-fs.h /usr/include/libpq-events.h /usr/include/libpq-fe.h # gcc -I/usr/include sample.c でもおなじです どうすればコンパイル出きるようになるでしょうか? よろしくお願いします

  • コンパイル時のエラー

    UNIXでサーバー、クライアントのCプログラミングをテキストどおりに書いてコンパイルしたのですが、以下のエラーが出ます。gcc, ccでコンパイルすると以下のようになるのですが、これはどういうことなのでしょうか?何が原因なのでしょうか?よろしくお願いいたします。 gcc unix_server.c /var/tmp/ccvpay1f1.o: In function `main': /var/tmp/ccvpay1f1.o(.text+0x8c): undefined reference to `socket' /var/tmp/ccvpay1f1.o(.text+0x104): undefined reference to `unllnk' /var/tmp/ccvpay1f1.o(.text+0x118): undefined reference to `bind' /var/tmp/ccvpay1f1.o(.text+0x150): undefined reference to `listen' /var/tmp/ccvpay1f1.o(.text+0x1a8): undefined reference to `accept' cc unix_server.c ld: /usr/lib/cmplrs/cc/crtn.o: Error: Unresolved: rindex socket bzero bcopy unllnk bind listen accept

  • C言語のpow関数の不具合

    linux(ubuntu)の上でgccを使っています。 powの関数がおかしいです。 pow(10,-1)を計算させると正しく1e-1が出力されます。 #include <math.h> #include <stdio.h> int main(void){ double x = -1; printf("%f",pow(10,x)); return 0; } 上記のプログラムを走らせると、 In function "main"; *****.c:(.text+0x2d):undefined reference to 'pow' collect2: ldはステータス1で終了しました。 というエラーメッセージがでます。 なぜかpow関数の中に変数を入れるとプログラムが動きません。

  • C言語コンパイラーエラーについて教えてください。

    C言語でコンパイルができなくて困っています。 コンパイルをすると、 ----------------------------------------- test.c.20:undefined reference to `getcury' test.c:20: undefined reference to `getcurx' collect2: ld returned 1 exit status ----------------------------------------- と言うエラーが出てしまい、コンパイルが完了しません。 ソースは、「test.c」と言うファイルネームで、内容は ----------------------------------------- #include <stdio.h> #include <stdlib.h> #include <curses.h> int main (void) { int y = 0, x = 0; initscr(); getyx(curscr, y, x); printw("x = %d, y = %d", x, y); refresh(); getchar(); endwin(); return 0; } ----------------------------------------- です。 OSは、Windows7 Professional SP1 コンパイラーは、MinGW Ver5.1.6. で、コマンドは gcc -o test.exe test.c -lcurses です。 確かに、curses へはパスも通っており、リンクできているようなんですが、 エラーが出てしまいます。 どうすれば良いのかわからず、大変困っています。 だれかご存知の方、教えてください。 どうかよろしくお願い致します。

  • Windowsコモンコントロールのcygwin/gccコンパイルエラー

    以下のサイトのようなWindowsコモンコントロールのプログラムをcygwin/gccコンパイルするとエラーがでます。 (sourceのサイト) http://wisdom.sakura.ne.jp/system/winapi/common/common16.html (ビルドコマンド) gcc -mwindows -mno-cygwin -o main.exe main.cpp (エラー出力) undefined reference to `_ImageList_Destroy@4' undefined reference to `_InitCommonControls@0' undefined reference to `_ImageList_Create@20' undefined reference to `_ImageList_ReplaceIcon@12' undefined reference to `_ImageList_ReplaceIcon@12' collect2: ld returned 1 exit status make: *** [main.exe] Error 1 Windowsコモンコントロールを含んだプログラムをcygwin/gccコンパイルするにはどうすればよいでしょうか? コンパイルは出来ないのでしょうか? よろしくお願いします。

専門家に質問してみよう