尝试在 Linux 上制作 pngnq 时链接到 libpng 的问题
我正在尝试安装 pngnq,它依赖于 libpng >= 1.2.8。我已经通过 ./configure
、make
、sudo make install
安装了 libpng
1.5.7 (没有问题),因为软件中心的libpng
版本太旧了。我现在尝试通过 ./configure
、make
、sudo make install
安装 pngnq
(同样,因为软件中心版本太旧),但我陷入了错误消息的 make
步骤,我相信这些错误消息与 libpng
链接有关。错误消息的一小部分示例:
undefined reference to `png_destroy_write_struct'
undefined reference to `png_convert_from_time_t'
undefined reference to `png_set_PLTE'
我在 Linux 上手动安装软件的经验有限,因此不太确定诊断问题的下一步是什么。我已经进行了大量搜索,但还没有真正找到任何针对我遇到的问题的内容。基于类似问题的论坛帖子,我在 /usr/local/lib
目录上做了 ls
并发现:
libpng15.a libpng15.so.15 libpng.la libpng15.la
libpng15.so.15.7.0 libpng.so libpng15.so libpng.a
虽然我不知道这是否是实际上对于诊断/排除某些问题有任何用处。任何人都可以告诉我可能出了什么问题,保留我在 Linux 上编译代码的最少经验吗?
编辑:
根据要求,以下是从 make
调用开始的跟踪示例:
bryce@whatever:~/Downloads/pngnq-1.1$ make
Making all in src
make[1]: Entering directory `/home/bryce/Downloads/pngnq-1.1/src'
make all-am
make[2]: Entering directory `/home/bryce/Downloads/pngnq-1.1/src'
gcc `libpng-config --I_opts` -Wall --pedantic -std=gnu99 -g -O2 `libpng-config
--ldflags` -lz -o pngnq pngnq.o neuquant32.o rwpng.o -lm -lz
pngnq.o: In function `pngnq':
/home/bryce/Downloads/pngnq-1.1/src/pngnq.c:518: undefined reference to `png_get_gAMA'
I am trying to install pngnq, which relies on libpng >= 1.2.8. I have installed libpng
1.5.7 via ./configure
, make
, sudo make install
(without problems), because the libpng
version in the Software Center was too old. I am now trying to install pngnq
via ./configure
, make
, sudo make install
(again, because Software Center version is too old), but am getting stuck at the make
step on error messages which I believe pertain to libpng
linking. A small sample of the error messages:
undefined reference to `png_destroy_write_struct'
undefined reference to `png_convert_from_time_t'
undefined reference to `png_set_PLTE'
I have limited experience with installing software manually on Linux, and so am not really sure what the next step is in diagnosing the problem. I've done substantial searching, but haven't really found anything targeted at the issue I'm having. Based on a forum post on a similar-ish issue I've done an ls
on /usr/local/lib
directory and found:
libpng15.a libpng15.so.15 libpng.la libpng15.la
libpng15.so.15.7.0 libpng.so libpng15.so libpng.a
though I don't know if that's actually any use in diagnosing/ruling out certain problems. Can anyone advise what might be wrong, keeping in my my minimal experience with compiling code on Linux?
Edit:
As requested, here is a sample of the trace beginning at the make
call:
bryce@whatever:~/Downloads/pngnq-1.1$ make
Making all in src
make[1]: Entering directory `/home/bryce/Downloads/pngnq-1.1/src'
make all-am
make[2]: Entering directory `/home/bryce/Downloads/pngnq-1.1/src'
gcc `libpng-config --I_opts` -Wall --pedantic -std=gnu99 -g -O2 `libpng-config
--ldflags` -lz -o pngnq pngnq.o neuquant32.o rwpng.o -lm -lz
pngnq.o: In function `pngnq':
/home/bryce/Downloads/pngnq-1.1/src/pngnq.c:518: undefined reference to `png_get_gAMA'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来包含与库不匹配。仔细检查 /usr/include 中是否有 png.h 或 /usr/lib/ 中是否有 libpng* 。
还显示在看到错误之前显示的 gcc 行。这可能就说明了问题所在。
Sounds like includes don't match the library. Double check to see if you've got png.h in /usr/include or libpng* in /usr/lib/.
Also show the gcc line that shows up before you see the error. That might point to the issue.