使用./configure -prefix /opt/Qt-5.6 -gstreamer 1.0 make make install 編譯後,qml audio能夠播放mp3了,也就是qtmutimedia已經使用 gstreamer 1.0了,可是qml界面只能顯示英文,全部中文漢字都不顯示了。html
靜態編譯命令: ./configure -static -prefix /opt/Qt-5.8-static -gstreamer 1.0 -fontconfiglinux
./configure -prefix /opt/Qt-5.6 -gstreamer 1.0 -fontconfiggit
make -j4github
FontConfig ............. noubuntu
sudo apt install libfontconfig1-dev
FontConfig ............. Yesapp
http://doc.qt.io/qt-5/qt-embedded-fonts.htmlless
解釋:Qt normally uses fontconfig
to provide access to system fonts. Iffontconfig
is not available, e.g. in dedicated embedded systems where space is at a premium, Qt will fall back to using QBasicFontDatabase
. In this case, Qt applications will look for fonts in Qt's lib/fonts/
directory. Qt will automatically detect prerendered fonts and TrueType fonts.ide
若是fontconfig 是 no,Qt就不能使用系統字體,只能使用lib/fonts 目錄下的字體,沒提供漢字字體,所以qml界面的漢字沒法顯示。字體
關於-qt-xcb選項的解釋:It's possible to configure Qt with -qt-xcb, which compiles in a set of xcb helper libraries instead of trying to link against the system versions. This can help make Qt less dependent on some of the xcb helper libraries that might not be available on all distributions. The table specifies which dependencies are provided by -qt-xcb. 資料來源:http://doc.qt.io/qt-5/linux-requirements.htmlui
Ubuntu16.04 gcc5.4.0編譯Qt5.8 beta版時,以下錯誤
painting/qdrawhelper.cpp: In function ‘void blend_transformed_tiled_argb(int, const QSpan*, void*)’:
painting/qdrawhelper.cpp:4846:13: internal compiler error: Segmentation fault
static void blend_transformed_tiled_argb(int count, const QSpan *spans, void *u^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
Makefile:46611: recipe for target '.obj/qdrawhelper.o' failed
make[3]: *** [.obj/qdrawhelper.o] Error 1
搜索後,初步斷定是gcc編譯器bug
Ubuntu 安裝最新的gcc https://gist.github.com/application2000/73fd6f4bf1be6600a2cf9f56315a2d91
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
sudo apt-get update && \
sudo apt-get install gcc-snapshot -y && \
sudo apt-get update && \
sudo apt-get install gcc-6 g++-6 -y && \
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6 && \
sudo apt-get install gcc-4.8 g++-4.8 -y && \
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8;When completed, you must change to the gcc you want to work with by default
sudo update-alternatives --config gccTo verify if it worked. Just type in your terminal
gcc -vIf everything went fine you should see gcc 6.1.1 by the time I am writing this gist
Happy coding!
gcc升級到6.2.0後編譯經過