VideoWriter Doesn't work using openCV, ubuntu, Qt - qt

My code:
cv::VideoWriter(
strFile.toStdString(),
cv::VideoWriter::fourcc('m','p','4','v'),
nfps,
cv::Size(1920/nresize, 1080/nresize)
);
Error message:
[mpeg4_v4l2m2m # 0x7f50a43c50] arm_release_ver of this libmali is 'g6p0-01eac0', rk_so_ver is '7'.
Could not find a valid device
[mpeg4_v4l2m2m # 0x7f50a43c50] can't configure encoder
If I use MJPG codec, it works fine thow.
This is OPENCV configure info:
-- General configuration for OpenCV 4.6.0 =====================================
-- Version control: unknown
--
-- Extra modules:
-- Location (extra): /home/firefly/Downloads/opencv_contrib-4.6.0/modules
-- Version control (extra): unknown
--
-- Platform:
-- Timestamp: 2023-01-19T02:11:26Z
-- Host: Linux 5.10.110 aarch64
-- CMake: 3.16.3
-- CMake generator: Unix Makefiles
-- CMake build tool: /usr/bin/make
-- Configuration: Release
--
-- CPU/HW features:
-- Baseline: NEON FP16
--
-- C/C++:
-- Built as dynamic libs?: YES
-- C++ standard: 11
-- C++ Compiler: /usr/bin/c++ (ver 9.4.0)
-- C++ flags (Release): -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
-- C++ flags (Debug): -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
-- C Compiler: /usr/bin/cc
-- C flags (Release): -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG
-- C flags (Debug): -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
-- Linker flags (Release): -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined
-- Linker flags (Debug): -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined
-- ccache: NO
-- Precompiled headers: NO
-- Extra dependencies: dl m pthread rt
-- 3rdparty dependencies:
--
-- OpenCV modules:
-- To be built: aruco barcode bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dnn_superres dpm face features2d flann freetype fuzzy gapi hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot quality rapid reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab wechat_qrcode xfeatures2d ximgproc xobjdetect xphoto
-- Disabled: world
-- Disabled by dependency: -
-- Unavailable: alphamat cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv hdf java julia matlab ovis python2 python3 sfm viz
-- Applications: tests perf_tests apps
-- Documentation: NO
-- Non-free algorithms: NO
--
-- GUI: GTK3
-- GTK+: YES (ver 3.24.20)
-- GThread : YES (ver 2.64.6)
-- GtkGlExt: NO
-- VTK support: NO
--
-- Media I/O:
-- ZLib: /usr/lib/aarch64-linux-gnu/libz.so (ver 1.2.11)
-- JPEG: /usr/lib/aarch64-linux-gnu/libjpeg.so (ver 80)
-- WEBP: build (ver encoder: 0x020f)
-- PNG: /usr/lib/aarch64-linux-gnu/libpng.so (ver 1.6.37)
-- TIFF: /usr/lib/aarch64-linux-gnu/libtiff.so (ver 42 / 4.1.0)
-- JPEG 2000: build (ver 2.4.0)
-- OpenEXR: build (ver 2.3.0)
-- HDR: YES
-- SUNRASTER: YES
-- PXM: YES
-- PFM: YES
--
-- Video I/O:
-- DC1394: YES (2.2.5)
-- FFMPEG: YES
-- avcodec: YES (58.54.100)
-- avformat: YES (58.29.100)
-- avutil: YES (56.31.100)
-- swscale: YES (5.5.100)
-- avresample: YES (4.0.0)
-- GStreamer: YES (1.16.2)
-- v4l/v4l2: YES (linux/videodev2.h)
--
-- Parallel framework: pthreads
--
-- Trace: YES (with Intel ITT)
--
-- Other third-party libraries:
-- Lapack: NO
-- Eigen: NO
-- Custom HAL: YES (carotene (ver 0.0.1))
-- Protobuf: build (3.19.1)
--
-- OpenCL: YES (no extra features)
-- Include path: /home/firefly/Downloads/opencv-4.6.0/3rdparty/include/opencl/1.2
-- Link libraries: Dynamic load
--
-- Python (for build): /usr/bin/python2.7
--
-- Java:
-- ant: NO
-- JNI: NO
-- Java wrappers: NO
-- Java tests: NO
--
============================================================================================
ffmpeg info:
============================================================================================
ffmpeg
ffmpeg version 4.2.4-1ubuntu1.0firefly5 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
configuration: --prefix=/usr --extra-version=1ubuntu1.0firefly5 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --arch=arm64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libdrm --enable-librga --enable-rkmpp --enable-version3 --disable-libopenh264 --disable-vaapi --disable-vdpau --disable-decoder=h264_v4l2m2m --disable-decoder=vp8_v4l2m2m --disable-decoder=mpeg2_v4l2m2m --disable-decoder=mpeg4_v4l2m2m --enable-shared --disable-doc
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
====================================================================================

Related

How to make Qt static build run without install vc_redist.x64.exe

I want to build Qt 5.10.1 using MSVC2015, and without MSVC Runtime.
Followed http://amin-ahmadi.com/2016/09/22/how-to-build-qt-5-7-statically-using-msvc14-microsoft-visual-studio-2015/
Configure:
configure -static -debug-and-release -prefix
"C:\Qt\5.10.1-static-msvc2015" -platform win32-msvc2015 -qt-zlib
-qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -sql-sqlite -sql-odbc -no-openssl -opensource -confirm-license -make libs -nomake tools -nomake examples -nomake tests
modified src\qtbase\mkspecs\common\msvc-desktop.conf change -MD to -MT.
No error during building, but if I don't install MSVC runtime when I run my program will get:
api-ms-win-crt-runtime-l1-1-0.dll missing.
How to make the MSVC static standalone like Mingw static build?
The output of compiling test program:
cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline
-Zc:strictStrings -Zc:throwingNew -O2 -MT -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc -DUNICODE -D_UNICODE -DWIN32 -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_MULTIMEDIA_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DNDEBUG
If I don't do step 2, the output will be -MD.
So Why the -MT (step 2) didn't work?
If you having any idea or guessing, Please comment.
Update:
Win10 64
No matter I add -static-runtime or not, both can run with without vc_redist
Win 7 32
Qt 5.10.1 compilation passed, but got api-ms-win-core-winrt-l1-1-0.dll is missing when executing the program.
Even I reinstall vc_redist still got the error...
Relate: Why installed vc_redist still gives api-ms-win-core-winrt-l1-1-0.dll is missing
Qt 5.11.1 compilation also passed, but got C1083: 'QtCore/qglobal.h':No such file or directory when building the program.
Compiling Qt sources from Qt 5.5.0 you can pass -static-runtime argument to configure for static runtime.
Changes 5.5.0:
[Windows] Added -static-runtime option.
Config Options:
-static-runtime ...... With -static, use static runtime [no] (Windows only)

Error building Ada Web Server (AWS) on OS X El Capitan

I am trying to build AWS from git tree:
$ git clone --recursive http://forge.open-do.org/anonscm/git/aws/aws.git
and I have the following errors:
$ make setup build
gprbind xoscons.bexch
gnatbind xoscons.ali
gcc -c b__xoscons.adb
gcc xoscons.o -o xoscons
Setup OS specific definitions
aws-os_lib-tmplt.c:77:20: fatal error: stdlib.h: No such file or directory
#include <stdlib.h>
^
compilation terminated.
Can not generate system tags. The test are disabled
object directory "/Users/adrian/Desktop/aws/tools/../.build/x86_64-apple-darwin13.4.0/release/static/obj/tools/" created
object directory "/users/adrian/desktop/aws/include/zlib/../../.build/x86_64-apple-darwin13.4.0/release/static/obj/zlib" created for project zlib
library directory "/users/adrian/desktop/aws/include/zlib/../../.build/x86_64-apple-darwin13.4.0/release/static/lib/zlib" created for project zlib
object directory "/users/adrian/desktop/aws/include/../.build/x86_64-apple-darwin13.4.0/release/static/obj/include" created for project include
library directory "/users/adrian/desktop/aws/include/../.build/x86_64-apple-darwin13.4.0/release/static/lib/include" created for project include
object directory "/users/adrian/desktop/aws/ssl/../.build/x86_64-apple-darwin13.4.0/release/static/obj/ssl" created for project ssl
library directory "/users/adrian/desktop/aws/ssl/../.build/x86_64-apple-darwin13.4.0/release/static/lib/ssl" created for project ssl
object directory "/users/adrian/desktop/aws/src/../.build/x86_64-apple-darwin13.4.0/release/static/obj/src" created for project src
library directory "/users/adrian/desktop/aws/src/../.build/x86_64-apple-darwin13.4.0/release/static/lib/src" created for project src
library directory "/Users/adrian/Desktop/aws/.build/x86_64-apple-darwin13.4.0/release/static/lib/aws" created for project aws
exec directory "/Users/adrian/Desktop/aws/tools/../.build/x86_64-apple-darwin13.4.0/release/static/tools" created for project tools
gcc -c -gnat2012 -gnatwcfijkmRuv -gnaty3abBcdefhiIklmnoOprstx -O2 -gnatn -fno-common awsres.adb
gcc -c -gnat2012 -gnatwcfijkmRuv -gnaty3abBcdefhiIklmnoOprstx -O2 -gnatn -fno-common aws_password.adb
gcc -c -gnat2012 -gnatwcfijkmRuv -gnaty3abBcdefhiIklmnoOprstx -O2 -gnatn -fno-common templates2ada.adb
gcc -c -gnat2012 -gnatwcfijkmRuv -gnaty3abBcdefhiIklmnoOprstx -O2 -gnatn -fno-common webxref.adb
gcc -c -gnat2012 -gnatwcfijkmRuv -gnaty3abBcdefhiIklmnoOprstx -O2 -gnatn -fno-common templatespp.adb
gcc -c -gnat2012 -gnatwcfijkmRuv -gnaty3abBcdefhiIklmnoOprstx -O2 -gnatn -fno-common wsdl2aws.adb
gcc -c -gnat2012 -O2 -gnatws -gnatn -fno-common zlib.adb
gcc -c -gnat2012 -O2 -gnatws -gnatn -fno-common zlib-thin.adb
gcc -c -gnat2012 -O2 -gnatws -gnatn -fno-common zlib-streams.adb
gcc -c -gnat2012 -O2 -gnatws -gnatn -fno-common memory_streams.adb
gcc -c -gnat2012 -gnatwcfijkmRuv -gnaty3abBcdefhiIklmnoOprstx -O2 -gnatn -fno-common templates_parser-xml.adb
gcc -c -gnat2012 -gnatwcfijkmRuv -gnaty3abBcdefhiIklmnoOprstx -O2 -gnatn -fno-common soap.ads
gcc -c -gnat2012 -gnatwcfijkmRuv -gnaty3abBcdefhiIklmnoOprstx -O2 -gnatn -fno-common soap-xml.adb
gcc -c -gnat2012 -gnatwcfijkmRuv -gnaty3abBcdefhiIklmnoOprstx -O2 -gnatn -fno-common soap-wsdl.adb
gcc -c -gnat2012 -gnatwcfijkmRuv -gnaty3abBcdefhiIklmnoOprstx -O2 -gnatn -fno-common soap-wsdl-types.adb
aws-os_lib.ads:30:01: cannot compile configuration pragmas with gcc
aws-os_lib.ads:30:01: use gnatchop -c to process configuration pragmas
compilation abandoned
soap-xml.adb:32:14: warning: license of withed unit "DOM.Core.Nodes" may be inconsistent
soap-xml.ads:34:09: warning: license of withed unit "DOM.Core" may be inconsistent
soap-wsdl.adb:35:09: warning: license of withed unit "DOM.Readers" may be inconsistent
soap-wsdl.adb:36:19: warning: license of withed unit "Input_Sources.File" may be inconsistent
soap-wsdl.adb:37:09: warning: license of withed unit "Sax.Readers" may be inconsistent
soap-wsdl.ads:32:09: warning: license of withed unit "DOM.Core" may be inconsistent
templates_parser-xml.adb:33:14: warning: license of withed unit "DOM.Core.Nodes" may be inconsistent
templates_parser-xml.adb:34:09: warning: license of withed unit "DOM.Readers" may be inconsistent
templates_parser-xml.adb:35:19: warning: license of withed unit "Input_Sources.File" may be inconsistent
templates_parser-xml.adb:36:19: warning: license of withed unit "Input_Sources.Strings" may be inconsistent
templates_parser-xml.adb:37:09: warning: license of withed unit "Sax.Readers" may be inconsistent
templates_parser-xml.adb:38:17: warning: license of withed unit "Unicode.CES.Basic_8bit" may be inconsistent
templates_parser-xml.adb:39:17: warning: license of withed unit "Unicode.CES.Utf8" may be inconsistent
compilation of awsres.adb failed
gprbuild: *** compilation phase failed
make: *** [build-native] Error 4
A package downloaded from Libre (aws-gpl-2015) stopped building at aws-os_lib.ads.
Any pointers to get this going? I have read successful build of AWS package from Libre on OS X Maverick.
Should I use the git tree or the package from Libre?
I am running GNAT GPL 2015 (20150428-49) on El Capitan 10.11.2.
Thanks.
aws-os_lib.ads is a file that is generated from the C file where your log shows an error..., so perhaps it was not correctly generated in your case ?
Have you installed the xcode command line tools ?
xcode-select --install

Qt 5.5.1 msvc2015 build error

I'm trying to build Qt 5.5.1 from sources on Windows 10 with with msvc2015.
It was configured with:
configure.bat -release -opensource -c++11 -no-angle -opengl dynamic -shared -confirm-license -make libs -make tools -nomake examples -platform win32-msvc2015 -target xp -no-iconv -no-fontconfig -no-system-proxies -no-icu -qmake -no-rtti -strip -no-libproxy -no-dbus -no-qml-debug -mp
With this config and every time I try to change -opengl option I get an error without any meaningful message:
cl -c -FIqt_gui_pch.h -Yuqt_gui_pch.h -Fp.pch\release\Qt5Gui_pch.pch -nologo -Zc:wchar_t -FS -Zc:strictStrings -Zc:throwingNew -Os -MD -D_HAS_EXCEPTIONS=0 -MP -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -DUNICODE -DWIN32 -DQT_NO_USING_NAMESPACE -DQT_BUILD_GUI_LIB -DQT_BUILDING_QT -D_CRT_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_USE_BUNDLED_LIBPNG -DPNG_ARM_NEON_OPT=0 -DQT_ENABLE_HARFBUZZ_NG -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_NO_DYNAMIC_CAST -DNDEBUG -I. -I..\..\include -I..\..\include\QtGui -I..\..\include\QtGui\5.5.1 -I..\..\include\QtGui\5.5.1\QtGui -Itmp -I..\3rdparty\libpng -I..\3rdparty\zlib -I..\3rdparty\harfbuzz-ng\include -I..\3rdparty\zlib -I..\..\include\QtCore\5.5.1 -I..\..\include\QtCore\5.5.1\QtCore -I..\..\include\QtCore -I.moc\release -I..\..\mkspecs\win32-msvc2015 -Fo.obj\release\ #C:\Users\Alex\AppData\Local\Temp\qpixmapcache.obj.5800.148640.jom
moc_qbrush.cpp
moc_qplatformbackingstore.cpp
moc_qopenglshaderprogram.cpp
moc_qpainter.cpp
moc_qpdfwriter.cpp
moc_qvalidator.cpp
qdesktopservices.cpp
moc_qopengltimerquery.cpp
qpixmapcache.cpp
moc_qopenglengineshadermanager_p.cpp
link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /DLL /SUBSYSTEM:WINDOWS,5.01 /VERSION:5.5 /MANIFEST:embed /OUT:..\..\lib\Qt5Gui.dll #C:\Users\Alex\AppData\Local\Temp\Qt5Gui.dll.5800.153390.jom
Creating library ..\..\lib\Qt5Gui.lib and object ..\..\lib\Qt5Gui.exp
copy /y ..\..\lib\Qt5Gui.dll ..\..\bin
1 file(s) copied.
jom: C:\Qt\Qt5.5.1-msvc2015-shared-min\qtbase\Makefile [sub-src-make_first] Error 2
jom: C:\Qt\Qt5.5.1-msvc2015-shared-min\Makefile [module-qtbase-make_first] Error 2
I run Windows 10 under VirtualBox if it matters.
What could be the reason of the error and how to fix it?

qmake adds /usr/lib absolute path when cross compiling

I need to cross compile a Qt app for arm. This is what I do:
export SDK_MXC_PATH="/path/to/sdk"
export QMAKESPEC="${SDK_MXC_PATH}/usr/mkspecs/devices/linux-imx6-g++/"
export SDK_MXC_BIN="${SDK_MXC_PATH}/toolchain/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/"
export QMAKE="${SDK_MXC_BIN}/qmake"
export PATH="${SDK_MXC_BIN}:${PATH}"
${QMAKE} -spec ${QMAKESPEC}
make
The mkspec file seems to be fine:
include(../common/linux_device_pre.conf)
EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfshooks_imx6.cpp
QMAKE_INCDIR += $(SDK_MXC_PATH)/usr/include
QMAKE_LIBDIR += $(SDK_MXC_PATH)/usr/lib
QMAKE_LIBS_EGL += -lEGL -L$(SDK_MXC_PATH)/usr/lib
QMAKE_LIBS_OPENGL_ES2 += -lGLESv2 -lEGL -lGAL -L$(SDK_MXC_PATH)/usr/lib
QMAKE_LIBS_OPENVG += -lOpenVG -lEGL -lGAL -L$(SDK_MXC_PATH)/usr/lib
QMAKE_LIBDIR_OPENGL_ES2 = $(SDK_MXC_PATH)/usr/lib
QMAKE_LFLAGS += -Wl,-rpath-link=$(SDK_MXC_PATH)/usr/lib
QMAKE_CFLAGS_RELEASE += -DLINUX=1 -DEGL_API_FB=1 -O3 -march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 -mfloat-abi=softfp -mfpu=neon -ftree-vectorize -fomit-frame-pointer
QMAKE_CXXFLAGS_RELEASE += -DLINUX=1 -DEGL_API_FB=1 -O3 -march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 -mfloat-abi=softfp -mfpu=neon -ftree-vectorize -fomit-frame-pointer
include(../common/linux_device_post.conf)
load(qt_config)
Linking fails, with this error:
arm-none-linux-gnueabi-g++ -c -pipe -O2 -DLINUX=1 -DEGL_API_FB=1 -O3 -march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 -mfloat-abi=softfp -mfpu=neon -ftree-vectorize -fomit-frame-pointer -Wall -W -D_REENTRANT -fPIE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../path/to/sdk/usr/mkspecs/devices/linux-imx6-g++ -I. -I../../path/to/sdk/usr/include -I../../path/to/sdk/usr/include/QtWidgets -I../../path/to/sdk/usr/include/QtGui -I../../path/to/sdk/usr/include/QtCore -I. -I/path/to/sdk/usr/include -o main.o main.cpp
arm-none-linux-gnueabi-g++ -Wl,-rpath-link=/path/to/sdk/usr/lib -Wl,-O1 -Wl,-rpath,/usr/lib -o qt-hello main.o -L/path/to/sdk/usr/lib -L/path/to/sdk/usr/lib -lQt5Widgets -L/usr/lib -lQt5Gui -lQt5Core -lGLESv2 -lEGL -lGAL -lpthread
/usr/lib/libc_nonshared.a: could not read symbols: File format not recognized
collect2: ld returned 1 exit status
Makefile:183: recipe for target 'qt-hello' failed
make: *** [qt-hello] Error 1
I guess because it is trying to search libraries in /usr/lib
If I manually call the linker, removing -L/usr/lib it works and the executable can run on my target. The command below works, notice that I've removed -L/usr/lib
arm-none-linux-gnueabi-g++ -Wl,-rpath-link=/path/to/sdk/usr/lib -Wl,-O1 -Wl,-rpath,/usr/lib -o qt-hello main.o -L/path/to/sdk/usr/lib -L/path/to/sdk/usr/lib -lQt5Widgets -lQt5Gui -lQt5Core -lGLESv2 -lEGL -lGAL -lpthread
What can I do make qmake working as expected? I don't want to link manually or edit the Makefile each time it is generated by qmake.
Just having the same problem w/ compiling Qt itself - seems to affect anything that calls mesa. But mesa's .pc files are okay.
OTOH, Qt creates broken .pc files. Looking at their monstrous makefile generator code, it seems they ever understood that pkg-config handles dependencies on it's own - IOW: missed the whole point. (well, they
still didn't understand make either).
Yet the old story - still not at all suited for embedded systems.

Configure Qt library 4.8.1 error when I cross compile

I’m compiling the Qt with phonon and phonon-backend for my embedded board.
I type:
./configure -embedded arm -xplatform qws/linux-arm-g++ -qt-mouse-tslib -L/home/user/ev-sdk/rootfs/arm-a8-fs/usr/lib -L/home/user/Desktop/qt-everywhere-opensource-src-4.8.1/lib -I/home/user/ev-sdk/rootfs/arm-a8-fs/usr/include -I/home/user/ev-sdk/rootfs/arm-a8-fs/usr/include/freetype2/freetype/config -prefix /opt/qt_eng -little-endian -no-gif -no-libtiff -no-libmng -no-openssl -no-opengl -no-mmx -no-3dnow -no-sse -no-sse2 -no-largefile -no-sm -svg -v -no-feature-cursor -fast -opensource -release -no-multimedia -no-cups -no-nis -no-exceptions -nomake examples -nomake demos -no-sql-sqlite -no-g++-exceptions -phonon -phonon-backend -DQT_NO_QWS_CURSOR -DQT_THREAD_SUPPORT
with qmake.conf in /home/user/Desktop/qt-everywhere-opensource-src-4.8.1/mkspecs/qws/linux-arm-g++:
#
# qmake configuration for building with arm-linux-g++ #
include(../../common/gcc-base.conf)
include(../../common/gcc-base-unix.conf)
include(../../common/g++.conf)
include(../../common/linux.conf)
include(../../common/qws.conf)
QMAKE_CFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8
-mfpu=neon -mfloat-abi=softfp
DEFINES +=
# modifications to g++.conf
QMAKE_CC = sb2 -t imx53 gcc
QMAKE_CXX = sb2 -t imx53 g++
QMAKE_LINK = sb2 -t imx53 g++
QMAKE_LINK_SHLIB = sb2 -t imx53 g++
# modifications to linux.conf
QMAKE_AR = sb2 -t imx53 ar cqs
QMAKE_OBJCOPY = sb2 -t imx53 objcopy
QMAKE_STRIP = sb2 -t imx53 strip
load(qt_config)
If I remove -phonon -phonon-backend from option the compilation is successful.
If I put -phonon -phonon-backend
I have this error:
.
.
.
D-Bus auto-detection... ()
Project WARNING: Your mkspec is including 'common/g++.conf', but the mkspecs have been refactored
To fix this include 'common/gcc-base-.conf and 'common/g++-.conf' instead
sb2 -t imx53 g++ -c -pipe -pipe -pipe -pipe -pipe -pipe -O2 -O2 -O2 -O2 -O2 -O2 -Wall -W -Wall -W -Wall -W -Wall -W -Wall -W -Wall -W -I../../../mkspecs/qws/linux-arm-g++ -I. -I/home/user/ev-sdk/rootfs/arm-a8-fs/usr/include -I/home/user/ev-sdk/rootfs/arm-a8-fs/usr/include/freetype2/freetype/config -I/usr/lib/glib-2.0/include -I/usr/include/glib-2.0 -o dbus.o dbus.cpp
dbus.cpp:43:23: error: dbus/dbus.h: No such file or directory
dbus.cpp:46:2: error: #error Needs at least dbus version 1
dbus.cpp: In function 'int main(int, char**)':
dbus.cpp:51: error: 'dbus_shutdown' was not declared in this scope
make: *** [dbus.o] Error 1
D-Bus disabled.
Glib auto-detection... ()
Project WARNING: Your mkspec is including 'common/g++.conf', but the mkspecs have been refactored
To fix this include 'common/gcc-base-.conf and 'common/g++-.conf' instead
sb2 -t imx53 g++ -c -pipe -pipe -pipe -pipe -pipe -pipe -O2 -O2 -O2 -O2 -O2 -O2 -Wall -W -Wall -W -Wall -W -Wall -W -Wall -W -Wall -W -I../../../mkspecs/qws/linux-arm-g++ -I. -I/home/user/ev-sdk/rootfs/arm-a8-fs/usr/include -I/home/user/ev-sdk/rootfs/arm-a8-fs/usr/include/freetype2/freetype/config -I/usr/lib/glib-2.0/include -I/usr/include/glib-2.0 -o glib.o glib.cpp
glib.cpp: In function 'int main(int, char**)':
glib.cpp:55: warning: 'pollfd' is used uninitialized in this function
sb2 -t imx53 g++ -Wl,-O1 -o glib glib.o -L/home/user/ev-sdk/rootfs/arm-a8-fs/usr/lib -L/home/user/Desktop/qt-everywhere-opensource-src-4.8.1/lib
*glib.o: In function `main':
glib.cpp:(.text+0x10): undefined reference to `g_thread_init'
glib.cpp:(.text+0x14): undefined reference to `g_main_context_default'
glib.cpp:(.text+0x20): undefined reference to `g_source_new'
glib.cpp:(.text+0x28): undefined reference to `g_source_add_poll'
glib.cpp:(.text+0x38): undefined reference to `g_threads_got_initialized'
collect2: ld returned 1 exit status
make: *** [glib] Error 1*
Glib disabled.
Phonon support cannot be enabled due to functionality tests!
Turn on verbose messaging (-v) to ./configure to see the final report.
If you believe this message is in error you may use the continue
switch (-continue) to ./configure to continue.
I lost the last two days to understand why giving error.
Could someone help me?
Debian/linux can use:
$ sudo apt-get install libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev
The command can be run before run ./configure
QMAKE_LIBDIR += -L$${ROOTFS_DIR}/usr/lib
QMAKE_CFLAGS += -I$${ROOTFS_DIR}/usr/include/glib-2.0
QMAKE_CFLAGS += -I$${ROOTFS_DIR}/usr/lib/glib-2.0/include
QMAKE_LIBS += -lgthread-2.0 -lglib-2.0 -v

Resources