1

ここにあるlibexif Cライブラリを使用するプログラムがありますhttp://libexif.sourceforge.net/

ライブラリをインストールしたところ、/usr/include/libexif にあります。

これらをプログラムの上部に含めます

#include <libexif/exif-data.h>
#include <libexif/exif-content.h>
#include <libexif/exif-entry.h>

私のコンパイル文:

`gcc -o test test.c` 

コンパイルすると、これらのエラーが発生します

/tmp/ccUUWpcw.o: In function `show_tag':
test.c:(.text+0x91): undefined reference to `exif_content_get_entry'
test.c:(.text+0xc0): undefined reference to `exif_entry_get_value'
test.c:(.text+0xef): undefined reference to `exif_tag_get_name_in_ifd'
/tmp/ccUUWpcw.o: In function `main':
test.c:(.text+0x179): undefined reference to `exif_data_new_from_file'
test.c:(.text+0x1cd): undefined reference to `exif_data_unref'
collect2: ld returned 1 exit status

プログラムはインクルードされたファイルを正常に読み取るように見えますが、何らかの理由でこれらの機能を認識していません。ライブラリをインストールしたときに行ったのは、解凍、./configure、make && make install だけでした。

このライブラリを他の場所または同様のものを参照する必要がありますか?

助けてくれてありがとう!

4

1 に答える 1

5

はい、ライブラリをリンクする必要があります:

gcc test.c -o test -lexif
于 2012-11-26T21:56:38.677 に答える