标题:qvfb编译出错
作者:sakiola
日期:2009-07-10 16:10
内容:
root@ss-desktop:/home/ss/qt-x11-opensource-src-4.5.1/tools/qvfb# make
g++ -c -pipe -g -O2 -Wall -W -D_REENTRANT -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I../../mkspecs/linux-g++ -I. -I../../include/QtCore -I../../include/QtGui -I../../include -I. -I. -I.moc/release-shared -I.uic/release-shared -o .obj/release-shared/qanimationwriter.o qanimationwriter.cpp
qanimationwriter.cpp:46:17: 错误: png.h:没有该文件或目录
qanimationwriter.cpp:74: 错误: ‘png_structp’没有命名一个类型
qanimationwriter.cpp:75: 错误: ‘png_infop’没有命名一个类型
qanimationwriter.cpp:107: 错误: ‘png_structp’未声明
qanimationwriter.cpp:107: 错误: ‘png_bytep’未声明
qanimationwriter.cpp:107: 错误: ‘png_size_t’未声明
qanimationwriter.cpp: In member function ‘void QAnimationWriterMNG::begin_png()’:
qanimationwriter.cpp:96: 错误: ‘png_ptr’在此作用域中尚未声明
qanimationwriter.cpp:96: 错误: ‘PNG_LIBPNG_VER_STRING’在此作用域中尚未声明
qanimationwriter.cpp:96: 错误: ‘png_create_write_struct’在此作用域中尚未声明
qanimationwriter.cpp:97: 错误: ‘info_ptr’在此作用域中尚未声明
qanimationwriter.cpp:97: 错误: ‘png_create_info_struct’在此作用域中尚未声明
qanimationwriter.cpp:98: 错误: ‘png_set_compression_level’在此作用域中尚未声明
qanimationwriter.cpp:99: 错误: ‘png_set_write_fn’在此作用域中尚未声明
qanimationwriter.cpp: In member function ‘void QAnimationWriterMNG::end_png()’:
qanimationwriter.cpp:104: 错误: ‘png_ptr’在此作用域中尚未声明
qanimationwriter.cpp:104: 错误: ‘info_ptr’在此作用域中尚未声明
qanimationwriter.cpp:104: 错误: ‘png_destroy_write_struct’在此作用域中尚未声明
qanimationwriter.cpp: In static member function ‘static void QAnimationWriterMNG::write(int, int, int)’:
qanimationwriter.cpp:109: 错误: ‘png_get_io_ptr’在此作用域中尚未声明
qanimationwriter.cpp: In member function ‘void QAnimationWriterMNG::writePNG(const QImage&)’:
qanimationwriter.cpp:118: 错误: ‘info_ptr’在此作用域中尚未 ..
#1 [sakiola 07-10 16:14]
补充:在.tools 的同级目录找到了src/3rdparty/libpng/png.h 不过放过去以后 再编译 出现更多错误
root@ss-desktop:/home/ss/qt-x11-opensource-src-4.5.1/tools/qvfb# make
g++ -c -pipe -g -O2 -Wall -W -D_REENTRANT -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I../../mkspecs/linux-g++ -I. -I../../include/QtCore -I../../include/QtGui -I../../include -I. -I. -I.moc/release-shared -I.uic/release-shared -o .obj/release-shared/qanimationwriter.o qanimationwriter.cpp
在包含自 qanimationwriter.cpp:46 的文件中:
./png.h:440:18: 错误: zlib.h:没有该文件或目录
./png.h:444:21: 错误: pngconf.h:没有该文件或目录
In file included from qanimationwriter.cpp:46:
./png.h:552: 错误: ‘png_byte’没有命名一个类型
./png.h:553: 错误: ‘png_byte’没有命名一个类型
./png.h:554: 错误: ‘png_byte’没有命名一个类型
./png.h:556: 错误: expected initializer before ‘*’ token
./png.h:557: 错误: expected initializer before ‘*’ token
./png.h:561: 错误: ‘png_byte’没有命名一个类型
./png.h:562: 错误: ‘png_uint_16’没有命名一个类型
./png.h:563: 错误: ‘png_uint_16’没有命名一个类型
./png.h:564: 错误: ‘png_uint_16’没有命名一个类型
./png.h:565: 错误: ‘png_uint_16’没有命名一个类型
./png.h:567: 错误: expected initializer before ‘*’ token
./png.h:568: 错误: expected initializer before ‘*’ token
./png.h:572: 错误: ‘png_byte’没有命名一个类型
./png.h:573: 错误: ‘png_byte’没有命名一个类型
./png.h:574: 错误: ‘png_byte’没有命名一个类型
./png.h:575: 错误: ‘png_byte’没有命名一个类型
./png.h:576: 错误: ‘png_byte’没有命名一个类型
./png.h:578: 错误: expected initializer before ‘*’ token
./png.h:579: 错误: expected initializer before ‘*’ token
./png.h:587: 错误: ‘png_uint_16’没有命名一个类型
./png.h:588: 错误: ‘png_uint_16’没有命名一个类型
./png.h:589: 错误: ‘png_uint_16’没有命名一个类型
./png.h:590: 错误: ‘png_uint_16’没有命名一个类型
./png.h:591: 错误: ‘png_uint_16’没有命名一个类型
./png.h:593: 错误: expected initial ..
#2 [sakiola 07-10 16:15]
崩溃中,哪位同仁指点~
#3 [sakiola 07-14 13:07]
才想起来来结贴 缺少的头文件都在qtx11 的tools同目录的src下
自己find到 放到/qvfb里去
再重新qmake -project.....
qmake
make之前修改Makefile
添加库 -lXtst
同时把之后出现的错误所指定的一个叫device什么的的cpp和.h文件也拷到qvfb目录去
OK
make搞定
具体步骤参见博文:http://blog.csdn.net/sakiola/archive/2009/07/13/4345187.aspx
#4 [styyzx 09-04 13:18]