【发布时间】:2012-10-28 19:35:33
【问题描述】:
我的项目需要 JPEG 处理能力,所以我决定使用 jpeg-8d 库,下载包后,我通常使用./configure; make and make install。 make test 没有返回任何错误,整个过程也没有报告任何问题,但是当我在 Code Blocks 10.05 中打开 example.c 时编译失败。我已经“搜索”了一些解决方案并添加了
#ifdef __cplusplus
extern "C" {
#endif
...
#ifdef __cplusplus
}
#endif
在jpeglib.h 文件中,重新编译,然后将这些行添加到代码块的链接器部分:
/usr/local/lib/libjpeg.a
/usr/local/lib/libjpeg.so
还根据目录添加到目录部分。
但是编译器仍然无法编译example.c,以下是一些错误:
> /home/raff/CodeBlocks/jpeg-8d/example.c|116|warning: incompatible implicit declaration of built-in function ‘exit’|
> example.c|| undefined reference to 'image_width'
> example.c|| undefined reference to 'image_height'
如果有人成功安装和使用 jpeg 库请帮忙,我在切换 IDE 和/或 linux 发行版时没有问题。
【问题讨论】:
标签: c++ jpeg static-libraries codeblocks libjpeg