• 6519阅读
  • 5回复

[提问]qvfb编译问题 [复制链接]

上一主题 下一主题
离线fq1110
 

只看楼主 倒序阅读 楼主  发表于: 2013-02-01
qvfb编译问题
— 本帖被 XChinux 从 Qt基础编程 移动到本区(2013-02-27) —

QT4 linux下编译qvfb时,编译成功,但链接出错
都是png相关函数  png_create_write_struct .......。
png.h的文件存在。没有提示找不到png.h文件。
libpng-dev卸载与安装后测试都没作用。
4.8.4的版本,有人遇到过这问题吗?
离线fq1110

只看该作者 1楼 发表于: 2013-02-27
In function `QAnimationWriter::QAnimationWriter(QString const&, char const*)':
qanimationwriter.cpp:(.text+0xa9c): undefined reference to `png_create_write_struct'
qanimationwriter.cpp:(.text+0xaa7): undefined reference to `png_create_info_struct'
qanimationwriter.cpp:(.text+0xabd): undefined reference to `png_set_compression_level'
qanimationwriter.cpp:(.text+0xadc): undefined reference to `png_set_write_fn'
.obj/release-shared/qanimationwriter.o: In function `QAnimationWriter::QAnimationWriter(QString const&, char const*)':
qanimationwriter.cpp:(.text+0xc1c): undefined reference to `png_create_write_struct'
qanimationwriter.cpp:(.text+0xc27): undefined reference to `png_create_info_struct'
qanimationwriter.cpp:(.text+0xc3d): undefined reference to `png_set_compression_level'
qanimationwriter.cpp:(.text+0xc5c): undefined reference to `png_set_write_fn'
.obj/release-shared/qanimationwriter.o: In function `QAnimationWriterMNG::setImage(QImage const&)':
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNG8setImageERK6QImage[QAnimationWriterMNG::setImage(QImage const&)]+0xb6): undefined reference to `png_write_chunk'
.obj/release-shared/qanimationwriter.o: In function `QAnimationWriterMNG::write(png_struct_def*, unsigned char*, unsigned int)':
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNG5writeEP14png_struct_defPhj[QAnimationWriterMNG::write(png_struct_def*, unsigned char*, unsigned int)]+0xd): undefined reference to `png_get_io_ptr'
.obj/release-shared/qanimationwriter.o: In function `QAnimationWriterMNG::composeImage(QImage const&, QPoint const&)':
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint[QAnimationWriterMNG::composeImage(QImage const&, QPoint const&)]+0x4a): undefined reference to `png_write_chunk'
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint[QAnimationWriterMNG::composeImage(QImage const&, QPoint const&)]+0x5d): undefined reference to `png_set_sig_bytes'
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint[QAnimationWriterMNG::composeImage(QImage const&, QPoint const&)]+0xc3): undefined reference to `png_set_IHDR'
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint[QAnimationWriterMNG::composeImage(QImage const&, QPoint const&)]+0xd5): undefined reference to `png_write_info'
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint[QAnimationWriterMNG::composeImage(QImage const&, QPoint const&)]+0xf0): undefined reference to `png_set_bgr'
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint[QAnimationWriterMNG::composeImage(QImage const&, QPoint const&)]+0x140): undefined reference to `png_write_image'
离线lishengwu

只看该作者 2楼 发表于: 2014-02-27
我也碰到这个问题了,请问,解决了吗?
离线dragon_fly

只看该作者 3楼 发表于: 2014-03-05
我试了下QT 4.8.5,也是这个问题,是不是缺少什么库,我用的redhat 6.5,是不是缺少lib
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNGD0Ev[_ZN19QAnimationWriterMNGD5Ev]+0x84): undefined reference to `png_write_chunk'
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNGD0Ev[_ZN19QAnimationWriterMNGD5Ev]+0x91): undefined reference to `png_destroy_write_struct'
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNGD0Ev[_ZN19QAnimationWriterMNGD5Ev]+0x134): undefined reference to `png_write_chunk'
collect2: ld returned 1 exit status
离线dragon_fly

只看该作者 4楼 发表于: 2014-03-05
解决办法:
ubuntu12.04 ,QT 4.8.5:
第一步:#locate libpng

电脑显示如下:
/lib/i386-linux-gnu/libpng12.so.0
/lib/i386-linux-gnu/libpng12.so.0.46.0
/usr/share/doc/libpng12-0
/usr/share/doc/libpng12-0/ANNOUNCE
/usr/share/doc/libpng12-0/KNOWNBUG
..........

第二步:建立链接#ln -s /lib/i386-linux-gnu/libpng12.so.0 /lib/i386-linux-gnu/libpng.so
第三步:修改Makefile文件,#gedit Makefile(或者 #vi Makefile),在LIBS后面添加-L/lib/i386-linux-gnu -lpng这两项
重新make后,成功!
离线dragon_fly

只看该作者 5楼 发表于: 2014-03-05
解决办法:
Redhat 6.5 x64 ,QT 4.8.5:
第一步:#locate libpng

电脑显示如下:
/usr/lib64/libpng.so.3
/usr/lib64/libpng.so.3.49.0
/usr/lib64/libpng12.so.0
/usr/lib64/libpng12.so.0.49.0

..........

第二步:建立链接# ln -s /usr/lib64/libpng12.so.0  /usr/lib64/libpng.so
第三步:修改Makefile文件,#gedit Makefile(或者 #vi Makefile),在LIBS后面添加-L/usr/lib64 -lpng这两项
重新make后,成功!
快速回复
限100 字节
 
上一个 下一个