我有一个程序,它使用在http://libexif.sourceforge.net/中找到的libexif C库
我安装了这个库,它位于/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
我是否需要在其他地方引用这个库或类似的东西?
谢谢你的帮助!
发布于 2012-11-27 05:56:39
是的,你需要链接库:
gcc test.c -o test -lexifhttps://stackoverflow.com/questions/13573802
复制相似问题