Ubuntu14.04下嵌入式Qt环境搭建之安装qvfb
2019-07-13 07:47发布
生成海报
Ubuntu的下交叉编译QT环境时,会涉及到qvfb程序的编译
主要是当解压完QT后,进入QT /工具/ qvfb的文件夹后编译
编译后执行操作如下:
#使
遇到问题1:
x11keyfaker.cpp:48:34:致命错误:X11 / extensions / XTest.h:没有那个文件或目录
编译中断.make:*** [.obj / release-shared / x11keyfaker.o]错误1
解决方法:
sudo apt-get install xorg-dev
遇到问题2:
未定义的引用`DeviceSkin :: read(QString const&,DeviceSkinParameters :: ReadMode,QString *)
总之是不能识别一切以DeviceSkin类相关的函数
解决办法:
去qt / tools / shared / deviceskin文件夹下把deviceskin.h和deviceskin.cpp文件拷贝到qvfb文件夹下,重新编译即可(一定要重新编译)
编译语句为:/ usr / local / qt / bin / qmake -project
在/ usr /本地/ QT /斌/ QMAKE
遇到问题3:
未定义的符号'XKeycodeToKeysym'的引用
其中XKeycodeToKeysym可为任何以X开头的函数名称
解决办法:
在编译出来的makefile的LIBS中添加-lXtst -X11
如果无法识别Xtst库,运行sudo apt-get install libxtst-dev
遇到问题4:
解决办法:
去的/ usr /本地/ QT / SRC / GUI /嵌入下拷贝qwslock.cpp和qwslock_p.h到QVFB文件夹下
老规矩,记得重新编译
遇到问题5:
。qanimationwriter.cpp :(文字+ 0x138):对'png_create_write_struct'未定义的引用qanimationwriter.cpp :(文字+ 0x143):对'png_create_info_struct'未定义的引用qanimationwriter.cpp :(文字+ 0x159):对'png_set_compression_level'未定义的引用qanimationwriter.cpp :(。text + 0x178):对'png_set_write_fn'未定义的引用.obj / release-shared / qanimationwriter.o:在函数'QAnimationWriterMNG :: write(png_struct_def *,unsigned char *,unsigned int)'中:qanimationwriter.cpp :(。text._ZN19QAnimationWriterMNG5writeEP14png_struct_defPhj [_ZN19QAnimationWriterMNG5writeEP14png_struct_defPhj] + 0xb):对'png_get_io_ptr'未定义的引用.obj / release-shared / qanimationwriter.o:在函数'QAnimationWriterMNG :: setImage (QImage const&)'中:qanimationwriter.cpp :(。text._ZN19QAnimationWriterMNG8setImageERK6QImage [_ZN19QAnimationWriterMNG8setImageERK6QImage] + 0xb0):对'png_write_chunk'未定义的引用.obj / release-shared / qanimationwriter.o:在函数'QAnimationWriterMNG :: composeImage(QImage const&,QPoint const&)'中:qanimationwriter.cpp :( text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint [_ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint] + 0x5c):对'png_write_chunk'未定义的引用qanimationwriter.cpp :( text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint [_ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint] + 0x76):对'png_set_sig_bytes'未定义的引用。qanimationwriter.cpp :( text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint [_ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint] + 0xd8):对'png_set_IHDR'未定义的引用qanimationwriter.cpp :( text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint [_ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint] + 0xea):对'png_write_info'未定义的引用qanimationwriter.cpp :( text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint [_ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint] + 0x105):对'png_set_bgr'未定义的引用qanimationwriter。 。CPP :( text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint [_ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint] + 0x164):对'png_write_image'未定义的引用qanimationwriter.cpp :( text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint [_ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint] + 0x182):对'png_write_end'未定义的引用。qanimationwriter.cpp :( text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint [_ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint] + 0x194):对'png_destroy_write_struct'未定义的引用qanimationwriter.cpp :( text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint [_ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint] + 0x1b8):对'png_create_write_struct'未定义的引用qanimationwriter。 。CPP :( text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint [_ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint] + 0x1c3):对'png_create_info_struct'未定义的引用qanimationwriter.cpp :( text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint [_ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint] + 0x1d9):对'png_set_compression_level'未定义的引用。qanimationwriter.cpp :( text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint [_ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint] + 0x1f8):对'png_set_write_fn'未定义的引用qanimationwriter.cpp :( text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint [_ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint] + 0x22f):对'png_set_filler'未定义的引用的obj /release-shared/qanimationwriter.o:with函数'QAnimationWriterMNG ::〜QAnimationWriterMNG()'中:qanimationwriter.cpp :(。text._ZN19QAnimationWriterMNGD2Ev [_ZN19QAnimationWriterMNGD5Ev] +0x8e):对'png_write_chunk'未定义的引用qanimationwriter.cpp: (.text._ZN19QAnimationWriterMNGD2Ev [_ZN19QAnimationWriterMNGD5Ev] + 0xa8):对'png_set_sig_bytes'未定义的引用qanimationwriter.cpp :( text._ZN19QAnimationWriterMNGD2Ev [_ZN19QAnimationWriterMNGD5Ev] + 0x10e):对'png_set_IHDR'未定义的引用qanimationwriter.cpp :( text._ZN19QAnimationWriterMNGD2Ev [_ZN19QAnimationWriterMNGD5Ev] +量0x120):对'png_write_info'未定义的引用qanimationwriter。 。CPP :( text._ZN19QAnimationWriterMNGD2Ev [_ZN19QAnimationWriterMNGD5Ev] + 0x13b):对'png_set_bgr'未定义的引用qanimationwriter.cpp :( text._ZN19QAnimationWriterMNGD2Ev [_ZN19QAnimationWriterMNGD5Ev] +量0x1A0):对'png_write_image'未定义的引用qanimationwriter.cpp: (.text._ZN19QAnimationWriterMNGD2Ev [_ZN19QAnimationWriterMNGD5Ev] + 0x1c1):对'png_write_end'未定义的引用qanimationwriter.cpp :( text._ZN19QAnimationWriterMNGD2Ev [_ZN19QAnimationWriterMNGD5Ev] + 0x1d3):对'png_destroy_write_struct'未定义的引用。qanimationwriter.cpp :( text._ZN19QAnimationWriterMNGD2Ev [_ZN19QAnimationWriterMNGD5Ev] + 0x1f7):对'png_create_write_struct'未定义的引用qanimationwriter.cpp :( text._ZN19QAnimationWriterMNGD2Ev [_ZN19QAnimationWriterMNGD5Ev] + 0x202):对'png_create_info_struct'未定义的引用qanimationwriter。 。CPP :( text._ZN19QAnimationWriterMNGD2Ev [_ZN19QAnimationWriterMNGD5Ev] + 0x218):对'png_set_compression_level'未定义的引用qanimationwriter.cpp :( text._ZN19QAnimationWriterMNGD2Ev [_ZN19QAnimationWriterMNGD5Ev] + 0x237):对'png_set_write_fn'未定义的引用qanimationwriter.cpp: (.text._ZN19QAnimationWriterMNGD2Ev [_ZN19QAnimationWriterMNGD5Ev] + 0x262):对'png_write_chunk'未定义的引用qanimationwriter.cpp :( text._ZN19QAnimationWriterMNGD2Ev [_ZN19QAnimationWriterMNGD5Ev] + 0x274):对'png_destroy_write_struct'未定义的引用qanimationwriter.cpp :( text._ZN19QAnimationWriterMNGD2Ev [_ZN19QAnimationWriterMNGD5Ev] + 0x32f):对'png_write_chunk'未定义的引用qanimationwriter.cpp :( text._ZN19QAnimationWriterMNGD2Ev [_ZN19QAnimationWriterMNGD5Ev] + 0x34f):对'png_set_filler'未定义的引用的obj /release-shared/qanimationwriter.o:with函数'QAnimationWriterMNG ::〜QAnimationWriterMNG()'中:qanimationwriter.cpp :(。text._ZN19QAnimationWriterMNGD0Ev [_ZN19QAnimationWriterMNGD0Ev] + 0x8e):对'png_write_chunk'未定义的引用qanimationwriter.cpp: (.text._ZN19QAnimationWriterMNGD0Ev [_ZN19QAnimationWriterMNGD0Ev] + 0xa8):对'png_set_sig_bytes'未定义的引用qanimationwriter.cpp :( text._ZN19QAnimationWriterMNGD0Ev [_ZN19QAnimationWriterMNGD0Ev] + 0x10e):对'png_set_IHDR'未定义的引用。qanimationwriter.cpp :( text._ZN19QAnimationWriterMNGD0Ev [_ZN19QAnimationWriterMNGD0Ev] +量0x120):对'png_write_info'未定义的引用qanimationwriter.cpp :( text._ZN19QAnimationWriterMNGD0Ev [_ZN19QAnimationWriterMNGD0Ev] + 0x13b):对'png_set_bgr'未定义的引用qanimationwriter。 。CPP :( text._ZN19QAnimationWriterMNGD0Ev [_ZN19QAnimationWriterMNGD0Ev] +量0x1A0):对'png_write_image'未定义的引用qanimationwriter.cpp :( text._ZN19QAnimationWriterMNGD0Ev [_ZN19QAnimationWriterMNGD0Ev] + 0x1c1):对'png_write_end'未定义的引用qanimationwriter.cpp: (.text._ZN19QAnimationWriterMNGD0Ev [_ZN19QAnimationWriterMNGD0Ev] + 0x1d3):对'png_destroy_write_struct'未定义的引用qanimationwriter.cpp :( text._ZN19QAnimationWriterMNGD0Ev [_ZN19QAnimationWriterMNGD0Ev] + 0x1f7):对'png_create_write_struct'未定义的引用qanimationwriter.cpp :( text._ZN19QAnimationWriterMNGD0Ev [_ZN19QAnimationWriterMNGD0Ev] + 0x202):对'png_create_info_struct'未定义的引用qanimationwriter.cpp :( text._ZN19QAnimationWriterMNGD0Ev [_ZN19QAnimationWriterMNGD0Ev] + 0x218):对'png_set_compression_level'未定义的引用qanimationwriter。 。CPP :( text._ZN19QAnimationWriterMNGD0Ev [_ZN19QAnimationWriterMNGD0Ev] + 0x237):对'png_set_write_fn'未定义的引用qanimationwriter.cpp :( text._ZN19QAnimationWriterMNGD0Ev [_ZN19QAnimationWriterMNGD0Ev] + 0x262):对'png_write_chunk'未定义的引用qanimationwriter.cpp: (.text._ZN19QAnimationWriterMNGD0Ev [_ZN19QAnimationWriterMNGD0Ev] + 0x274):对'png_destroy_write_struct'未定义的引用qanimationwriter.cpp :( text._ZN19QAnimationWriterMNGD0Ev [_ZN19QAnimationWriterMNGD0Ev] + 0x337):对'png_write_chunk'未定义的引用qanimationwriter.cpp :(。text._ZN19QAnimationWriterMNGD0Ev [_ZN19QAnimationWriterMNGD0Ev] + 0x357):对'png_set_filler'未定义的引用collect2:错误:ld返回1退出状态make:*** [qvfb]错误1
之所以粘这么多,是因为这龟孙问题卡了我一天时间
解决办法:
在Makefile的LIBS中添加-L / lib / i386-linux-gnu -lpng
西天取经的路终于成功的走完了第一步
最后把编译出来的QVFB文件拷贝到/usr/local/Trolltech/QtEmbedded-4.8.5/bin目录即可
LIBS = $(SUBLIBS)-L / usr / local / qt6-pc / lib -L / usr / X11R6 / lib -lpng -lz -lXtst -lQtGui -L / usr / local / qt6-pc / lib -L / usr / X11R6 / lib -lQtCore -lpthread -lXrender -lfontconfig -lfreetype -lXext -lX11 -lm(Makefile中的LIBS)
打开微信“扫一扫”,打开网页后点击屏幕右上角分享按钮