编译安装Qt可能出现的问题及解决办法



以下模块,yes的是qt默认安装的。

Debug ............... no

Qt 3 compatibility .. yes

QtDBus module ....... no

QtScriptTools module  yes

QtXmlPatterns module  yes

Phonon module ....... no

SVG module .......... yes

WebKit module ....... yes

STL support ......... yes

PCH support ......... yes

MMX/3DNOW/SSE/SSE2..  yes/yes/yes/yes

Graphics System ..... default

IPv6 support ........ yes

IPv6 ifname support . yes

getaddrinfo support . yes

getifaddrs support .. yes

Accessibility ....... yes

NIS support ......... yes

CUPS support ........ no

Iconv support ....... yes

Glib support ........ yes

GStreamer support ... no

Large File support .. yes

GIF support ......... plugin

TIFF support ........ plugin (qt)

JPEG support ........ plugin (system)

PNG support ......... yes (system)

MNG support ......... plugin (system)

zlib support ........ system

Session management .. yes

OpenGL support ...... yes (Desktop OpenGL)

NAS sound support ... no

XShape support ...... yes

XSync support ....... yes

Xinerama support .... runtime

Xcursor support ..... runtime

Xfixes support ...... runtime

Xrandr support ...... runtime

Xrender support ..... yes

Xi support .......... runtime

MIT-SHM support ..... yes

FontConfig support .. yes

XKB Support ......... yes

immodule support .... yes

GTK theme support ... no

PostgreSQL support .. plugin

SQLite 2 support .... plugin

SQLite support ...... plugin (qt)

OpenSSL support ..... yes (run-time)

所以,但我们开始装qt之前没有编译显示no的那些模块,我们可以

重新编译一次。

#./configure -phonon

但这时候,可能会提示以下内容,

Phonon support cannot be enabled due to functionality tests 

解决办法:

先下载必要的包:

sudo apt-get install libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev

重新#./configure -phonon

即可。。。


如出现
Basic XLib functionality test failed!
则先安装libxext-dev
sudo apt-get install libxext-dev

mark时出现
/usr/bin/ld: cannot find -lXext
则需安装libxt-dev
sudo apt-get install libxt-dev

mark时出现
/usr/bin/ld: cannot find -lXrender
则需安装libxrender-dev
sudo apt-get install libxrender-dev

出现
X11/extensions/Xdamage.h: No such file or directory
则安装libxdamage-dev
sudo apt-get install libxdamage-dev

About QtOpenGL
If try -opengl then: All the OpenGL functionality tests failed!
sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev

About QtDBus
If try -dbus then:The QtDBus module cannot be enabled because libdbus-1 version 0.93 was not found
sudo apt-get install libdbus-1-dev
sudo apt-get install libedbus-dev


gconf
sudo apt-get install libgconf2-dev

icu
sudo apt-get install libicu-dev

### qmake.conf的对OpenGL的配置是: ``` QMAKE_INCDIR_OPENGL = /opt/ArmLinux/opengl/include QMAKE_LIBDIR_OPENGL = /opt/ArmLinux/opengl/lib QMAKE_INCDIR_EGL = $$QMAKE_INCDIR_OPENGL/EGL QMAKE_LIBDIR_EGL = $$QMAKE_LIBDIR_OPENGL QMAKE_INCDIR_OPENGL_ES2 = $$QMAKE_INCDIR_OPENGL QMAKE_LIBDIR_OPENGL_ES2 = $$QMAKE_LIBDIR_OPENGL QMAKE_INCDIR_OPENVG = $$QMAKE_INCDIR_OPENGL QMAKE_LIBDIR_OPENVG = $$QMAKE_LIBDIR_OPENGL QMAKE_LIBS_EGL += -lEGL QMAKE_LIBS_OPENGL_ES2 += -lGLESv2 -lEGL -lGAL QMAKE_LIBS_OPENVG += -lOpenVG -lEGL -lGAL ``` ### configure的配置: ``` #!/bin/sh ./configure \ -prefix /opt/ArmLinux/QT5.9-ARM-Linux \ -xplatform linux-arm-gnueabi-g++ \ -release \ -opensource \ -verbose \ -make libs \ -no-xcb \ -no-dbus \ -nomake tests -nomake examples -nomake tools \ -no-opengl -opengl es2 -no-openssl \ -qt-zlib -qt-libjpeg -qt-libpng \ -confirm-license \ -skip qtdoc \ -skip qtgamepad \ -skip qtwayland \ -skip qtwebchannel \ -skip qtwebengine \ -skip qtwebsockets \ -skip qtwebview \ -skip qtandroidextras \ -skip qtwinextras \ -skip qtmacextras \ -skip qtpurchasing \ # -I /opt/ArmLinux/opengl/include 在这里加上路径也是一样会报错 # -L /opt/ArmLinux/opengl/lib ``` ### 而且也安装了libgles2-mesa、libgles2-mesa-dev ### OpenGL库的路径也没有错: include:</br> ![图片说明](https://img-ask.csdn.net/upload/202004/14/1586864908_789343.png) </br></br> lib: </br> ![图片说明](https://img-ask.csdn.net/upload/202004/14/1586865195_417161.png) ### 但配置的时候出错了: ``` ERROR: Feature 'opengles2' was enabled, but the pre-condition 'config.win32 || (!config.watchos && !features.opengl-desktop && libs.opengl_es2)' failed. ERROR: The OpenGL functionality tests failed! You might need to modify the include and library search paths by editing QMAKE_INCDIR_OPENGL[_ES2], QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your platform. ``` ### 不知道问题出在哪里,有没有大佬知道怎么解决?
<div class="post-text" itemprop="text"> <p>I'm trying to display textures on quads (2 triangles) using opengl 3.3</p> <p>Drawing a texture on a quad works great; however when I have ONE textures (sprite atlas) but using 2 quads(objects) to display different parts of the atlas. When in draw loop, they end up switching back and fourth(one disappears than appears again, etc) at their individual translated locations.</p> <p>The way I'm drawing this is not the standard DrawElements for each quad(or object) but I package all quads, uv, translations, etc send them up to the shader as one big chunk (as "in" variables): Vertex shader:</p> <pre><code> #version 330 core // Input vertex data, different for all executions of this shader. in vec3 vertexPosition_modelspace; in vec3 vertexColor; in vec2 vertexUV; in vec3 translation; in vec4 rotation; in vec3 scale; // Output data ; will be interpolated for each fragment. out vec2 UV; // Output data ; will be interpolated for each fragment. out vec3 fragmentColor; // Values that stay constant for the whole mesh. uniform mat4 MVP; ... void main(){ mat4 Model = mat4(1.0); mat4 t = translationMatrix(translation); mat4 s = scaleMatrix(scale); mat4 r = rotationMatrix(vec3(rotation), rotation[3]); Model *= t * r * s; gl_Position = MVP * Model * vec4 (vertexPosition_modelspace,1); //* MVP; // The color of each vertex will be interpolated // to produce the color of each fragment fragmentColor = vertexColor; // UV of the vertex. No special space for this one. UV = vertexUV; } </code></pre> <p>Is the vertex shader working as I think it would with a large chunk of data - that it draws each segment passed up as uniform individually because it does not seem like it? Is my train of thought correct on this?</p> <p>For completeness this is my fragment shader:</p> <pre><code>#version 330 core // Interpolated values from the vertex shaders in vec3 fragmentColor; // Interpolated values from the vertex shaders in vec2 UV; // Ouput data out vec4 color; // Values that stay constant for the whole mesh. uniform sampler2D myTextureSampler; void main() { // Output color = color of the texture at the specified UV color = texture2D( myTextureSampler, UV ).rgba; } </code></pre> <p>A request for more information was made so I will put how i bind this data up to the vertex shader. The following code is just one I use for my translations. I have more for color, rotation, scale, uv, etc:</p> <pre><code>gl.BindBuffer(gl.ARRAY_BUFFER, tvbo) gl.BufferData(gl.ARRAY_BUFFER, len(data.Translations)*4, gl.Ptr(data.Translations), gl.DYNAMIC_DRAW) tAttrib := uint32(gl.GetAttribLocation(program, gl.Str("translation\x00"))) gl.EnableVertexAttribArray(tAttrib) gl.VertexAttribPointer(tAttrib, 3, gl.FLOAT, false, 0, nil) </code></pre> <p>...</p> <pre><code>gl.DrawElements(gl.TRIANGLES, int32(len(elements)), gl.UNSIGNED_INT, nil) </code></pre> </div>
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页