Yocto/Qt5.6: Unable to build a sample Qt Application - linux

I have a working Nitrogen6x board that runs on Yocto Krogoth-next build with core-image-sato. I have installed Qt Creator 3.5.1 (based on Qt 5.5.1) and I have added my kit for nitrogen6x board as per [Build & Install Qt5 toolchain] document. I have added a sample Qt Quick Application with component set chosen as Qt Quick 2.1 and tried to compile the source, I am noticing this below error.
19:04:25: Running steps for project untitled6...
19:04:25: Starting: "/opt/poky/2.1.1/sysroots/i686-pokysdk-linux/usr/bin/qt5/qmake" /home/test/untitled6/untitled6.pro -r -spec linux-g++
19:04:25: The process "/opt/poky/2.1.1/sysroots/i686-pokysdk-linux/usr/bin/qt5/qmake" exited normally.
19:04:25: Starting: "/usr/bin/make"
g++ -c -pipe -O2 -std=gnu++0x -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I../untitled6 -I. -isystem /opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5 -isystem /opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/QtQuick -isystem /opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/QtGui -isystem /opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/QtQml -isystem /opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/QtNetwork -isystem /opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/QtCore -I. -I/opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/linux-g++ -o main.o ../untitled6/main.cpp
/opt/poky/2.1.1/sysroots/i686-pokysdk-linux/usr/bin/qt5/rcc -name qml ../untitled6/qml.qrc -o qrc_qml.cpp
g++ -c -pipe -O2 -std=gnu++0x -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I../untitled6 -I. -isystem /opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5 -isystem /opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/QtQuick -isystem /opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/QtGui -isystem /opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/QtQml -isystem /opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/QtNetwork -isystem /opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/QtCore -I. -I/opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/linux-g++ -o qrc_qml.o qrc_qml.cpp
g++ -Wl,-O1 -o untitled6 main.o qrc_qml.o -lQt5Quick -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lGLESv2 -lpthread
/usr/bin/ld: cannot find -lQt5Quick
/usr/bin/ld: cannot find -lQt5Gui
/usr/bin/ld: cannot find -lQt5Qml
/usr/bin/ld: cannot find -lQt5Network
/usr/bin/ld: cannot find -lQt5Core
/usr/bin/ld: cannot find -lGLESv2
collect2: ld returned 1 exit status
make: *** [untitled6] Error 1
19:04:26: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project untitled6 (kit: Nitrogen)
When executing step 'Make'
19:04:26: Elapsed time: 00:01.
All the Qt libraries are present under /sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/ and I have set the sysroot path correctly under my kit, but I am unable to figure out why is that my application is failing to reference those libraries. Any help on this is deeply appreciated. Thanks in advance.

The mkspec pointed to by your kit seem to be the wrong one (linux-g++), quoting from your build log
-I/opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/linux-g++
When building for a nitrogen6x, it should likely be linux-oe-g++ instead. This is either set by default in the Qt version you selected, or can be set by modifying the Kit itself, in QtCreator's options, under "mkspec".
The error your's seeing is probably due to the fact the that the ABI & architecture of the libraries pointed are not compatible with the x86/64 code you compiled.
Also make sure to source Yocto's environment file before starting QtCreator if you encounter problems (namely compile error about "C" not found). This will setup the path to the cross-compiler. Example:
source /opt/poky/1.6.2/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi
~/Qt/Tools/QtCreator/bin/qtcreator

Related

how to install Fortran -dev package using sudo yum install

I have installed (GCC) 4.7.2 20121015 (Red Hat 4.7.2-5) already and jave also installed yum install gcc-gfortran . (Package gcc-gfortran-4.4.7-18.el6.x86_64)
But I'm getting error like :
/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
make: *** [quadprog.so] Error 1
Please help me in installing -lgfortran. It seems like I need to install "Fortran -dev package providing the Fortran library". I do not know how to do that in RedHat/CentOS. Please help. I'm facing hard time in doing this.
I have tried installing libgfortran using:
yum install libgfortran
But it says:
Package libgfortran-4.4.7-18.el6.x86_64 already installed and latest version
Nothing to do
(Running in an interactive session, skipping clean step.)
More Info:
I tried installing package quadprog for R and below are the logs:
install.packages('https://cran.cnr.berkeley.edu/src/contrib/quadprog_1.5-5.tar.gz',dependencies = TRUE,repos = NULL,type ="source")
Installing package into '/usr/lib64/R/library'
(as 'lib' is unspecified)
trying URL 'https://cran.cnr.berkeley.edu/src/contrib/quadprog_1.5-5.tar.gz'
Content type 'application/x-gzip' length 33651 bytes (32 KB)
==================================================
downloaded 32 KB
* installing *source* package 'quadprog' ...
** package 'quadprog' successfully unpacked and MD5 sums checked
** libs
gfortran -m64 -fvisibility=hidden -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/lib64/gfortran/modules -c aind.f -o aind.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fpic -fPIC -c init.c -o init.o
gfortran -m64 -fvisibility=hidden -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/lib64/gfortran/modules -ffloat-store -c -o solve.QP.compact.o solve.QP.compact.f
solve.QP.compact.f:254.3:
72 if (nvl .EQ. 0) then
1
Warning: Label 72 at (1) defined but not used
solve.QP.compact.f:302.2:
7 t1inf = .FALSE.
1
Warning: Label 7 at (1) defined but not used
solve.QP.compact.f: In function 'qpgen1':
solve.QP.compact.f:94: warning: 'it1' may be used uninitialized in this function
solve.QP.compact.f:98: warning: 't1' may be used uninitialized in this function
gfortran -m64 -fvisibility=hidden -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/lib64/gfortran/modules -ffloat-store -c -o solve.QP.o solve.QP.f
solve.QP.f:245.3:
72 if (nvl .EQ. 0) then
1
Warning: Label 72 at (1) defined but not used
solve.QP.f:293.2:
7 t1inf = .FALSE.
1
Warning: Label 7 at (1) defined but not used
solve.QP.f: In function 'qpgen2':
solve.QP.f:85: warning: 'it1' may be used uninitialized in this function
solve.QP.f:89: warning: 't1' may be used uninitialized in this function
gfortran -m64 -fvisibility=hidden -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/lib64/gfortran/modules -c util.f -o util.o
gcc -m64 -std=gnu99 -shared -L/usr/lib64/R/lib -o quadprog.so aind.o init.o solve.QP.compact.o solve.QP.o util.o -L/usr/lib64/R/lib -lRblas -lgfortran -lm -lgfortran -lm -L/usr/lib64/R/lib -lR
/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
make: *** [quadprog.so] Error 1
ERROR: compilation failed for package 'quadprog'
* removing '/usr/lib64/R/library/quadprog'
Warning message:
In install.packages("https://cran.cnr.berkeley.edu/src/contrib/quadprog_1.5-5.tar.gz", :
installation of package '/tmp/Rtmpry5XTG/downloaded_packages/quadprog_1.5-5.tar.gz' had non-zero exit status
Edits :
bash-4.1# rpm -ql libgfortran
/usr/lib64/libgfortran.so.3
/usr/lib64/libgfortran.so.3.0.0
You showed us this:
# type -a gcc
gcc is /opt/centos/devtoolset-1.1/root/usr/bin/gcc
gcc is /usr/bin/gcc'
It means that you have installed Red Hat Developer Toolset and enabled it for this shell, using scl enable or a similar command. Do you still need it? If not, I suggest to disable it.
If you need DTS, you will have to install the Fortran compiler from DTS 1.1, using:
yum install devtoolset-1.1-gcc-gfortran
(Or download it directly from here, which seems to be the repository from where you got your DTS compiler.)
This will install the Fortran compiler which is compatible with the gcc compiler you have configured. Without that, the system Fortran compiler and the DTS gcc are used together, which does not work because the DTS gcc command (used for linking in the build process you quoted) is not able to locate the libgfortran.so library from the system Fortran compiler.
Alternatively, you can bring the two compilers into sync by deinstalling the DTS compiler:
yum install devtoolset-1.1-gcc-gfortran
The following compile line was looking for libgfortran at /usr/lib64/R/lib but the library is not there. Hence, the linker error.
gcc -m64 -std=gnu99 -shared -L/usr/lib64/R/lib -o quadprog.so aind.o init.o solve.QP.compact.o solve.QP.o util.o -L/usr/lib64/R/lib -lRblas -lgfortran -lm -lgfortran -lm -L/usr/lib64/R/lib -lR
As we could not locate and modify the makefile. We created a symbolic link /usr/lib64/R/lib/libgfortran.so to /usr/lib64/libgfortran.so.3 and rerun the installation steps and it resolves the linker error.
This is a work around that we follow which resolves the issue

Use only local library with cross compiler

I'm trying to build one application with cross compiler on linux. Application is based on OpenEmbedded project. Compiler and all cross compiled libraries are located in build folder. But for one package build script is trying to use a library from my linux environment.
Command which is called from make script at the end:
/bin/sh ./arm-ABC-linux-gnueabi-libtool --tag=CXX --mode=link
arm-ABC-linux-gnueabi-g++ -march=armv7-a -mtune=cortex-a8
-mfpu=neon -mfloat-abi=softfp -g --std=c++0x -pthread -L/home/ABC/build/sysroots/armv7a-ABC-linux-gnueabi/opt/my/lib
-Wl,-rpath-link,/home/ABC/build/sysroots/armv7a-ABC-linux-gnueabi/opt/my/lib
-Wl,-O1 -Wl,--hash-style=gnu -L/opt/my/lib -o modbus_server_test modbus_server_test.o Serial.o SerialUtil.o Crc.o RtuFramer.o Pdu.o
SerialMaster.o
/home/ABC/build/sysroots/armv7a-ABC-linux-gnueabi/usr/local/apr/lib/libapr-2.la
-lcrypt -luuid -lrt -lcrypt -lpthread -ldl -lexpat -lstdc++
Most important from here that is use -lexpat flag for libexpat.so.1.5.2 library. This library is cross compiled and located in the build folder, and at the same time, we have one in my linux environment.
As result I recieve the next error:
| arm-ABC-linux-gnueabi-libtool: link:
arm-ABC-linux-gnueabi-g++ -march=armv7-a -mtune=cortex-a8
-mfpu=neon -mfloat-abi=softfp -g --std=c++0x -pthread -Wl,-rpath-link -Wl,/home/ABC/build/sysroots/armv7a-ABC-linux-gnueabi/opt/my/lib
-Wl,-O1 -Wl,--hash-style=gnu -o .libs/modbus_server_test modbus_server_test.o Serial.o SerialUtil.o Crc.o RtuFramer.o Pdu.o
SerialMaster.o
-L/home/ABC/build/sysroots/armv7a-ABC-linux-gnueabi/opt/my/lib
-L/opt/my/lib /usr/local/apr/lib/libapr-2.so -L/home/ABC/build/sysroots/armv7a-ABC-linux-gnueabi/usr/lib
/usr/lib/x86_64-linux-gnu/libexpat.so
/home/ABC/build/sysroots/armv7a-ABC-linux-gnueabi/usr/lib/libuuid.so
-lrt -lcrypt -lpthread -ldl /home/ABC/build/sysroots/armv7a-ABC-linux-gnueabi/usr/lib/libexpat.so
/home/ABC/build/build/sysroots/armv7a-ABC-linux-gnueabi/usr/lib/libstdc++.so
-lm -pthread -Wl,-rpath -Wl,/usr/local/apr/lib -Wl,-rpath -Wl,/home/ABC/build/sysroots/armv7a-ABC-linux-gnueabi/usr/lib
| /usr/lib/x86_64-linux-gnu/libexpat.so: file not recognized: File
format not recognized
| collect2: ld returned 1 exit status
| make[2]: *** [modbus_server_test] Error 1
From output I can see that it include two libraries: one from linux environment (/usr/lib/x86_64-linux-gnu/libexpat.so which is x86) and one from the build folder (build/sysroots/armv7a-ABC-linux-gnueabi/usr/lib/libexpat.so which is for ARM).At the end it complains about x86 type.
How can I exclude this library from searching in global environment? Why it even trying to use both of them?

Brew install opencv failed at [44%]?

I am bumped into one intractable issue when I install opencv using linuxbrew.
Below is the error information, I googled it but found nothing works.
[ 44%] Built target opencv_features2d
[ 44%] Linking CXX shared library ../../lib/libopencv_objdetect.so
cd /tmp/opencv-20160725-28945-vyl9j5/opencv-2.4.13/macbuild/modules/objdetect && /home/usrname/.linuxbrew/Cellar/cmake/3.6.0/bin/cmake -E cmake_link_script CMakeFiles/opencv_objdetect.dir/link.txt --verbose=1
/usr/bin/g++-5 -fPIC -Os -w -pipe -march=native -fsigned-char -W -Wall - Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format- security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow - Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type- template-args -Wno-array-bounds -Wno-aggressive-loop-optimizations -fdiagnostics- show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 - ffunction-sections -DNDEBUG -DNDEBUG -L/home/usrname/.linuxbrew/lib -Wl,-- dynamic-linker=/home/usrname/.linuxbrew/lib/ld.so -Wl,- rpath,/home/usrname/.linuxbrew/lib -shared -Wl,- soname,libopencv_objdetect.so.2.4 -o ../../lib/libopencv_objdetect.so.2.4.13 CMakeFiles/opencv_objdetect.dir/src/cascadedetect.cpp.o CMakeFiles/opencv_objdetect.dir/src/datamatrix.cpp.o CMakeFiles/opencv_objdetect.dir/src/distancetransform.cpp.o CMakeFiles/opencv_objdetect.dir/src/featurepyramid.cpp.o CMakeFiles/opencv_objdetect.dir/src/fft.cpp.o CMakeFiles/opencv_objdetect.dir/src/haar.cpp.o CMakeFiles/opencv_objdetect.dir/src/hog.cpp.o CMakeFiles/opencv_objdetect.dir/src/latentsvm.cpp.o CMakeFiles/opencv_objdetect.dir/src/latentsvmdetector.cpp.o CMakeFiles/opencv_objdetect.dir/src/linemod.cpp.o CMakeFiles/opencv_objdetect.dir/src/lsvmparser.cpp.o CMakeFiles/opencv_objdetect.dir/src/lsvmtbbversion.cpp.o CMakeFiles/opencv_objdetect.dir/src/matching.cpp.o CMakeFiles/opencv_objdetect.dir/src/objdetect_init.cpp.o CMakeFiles/opencv_objdetect.dir/src/resizeimg.cpp.o CMakeFiles/opencv_objdetect.dir/src/routine.cpp.o ../../lib/libopencv_highgui.so.2.4.13 -ldl -lm -lpthread -lrt ../../lib/libopencv_imgproc.so.2.4.13 ../../lib/libopencv_core.so.2.4.13 -ldl -lm -lpthread -lrt -Wl,-rpath,/home/usrname/.linuxbrew/Cellar/opencv/2.4.13/lib
cd /tmp/opencv-20160725-28945-vyl9j5/opencv-2.4.13/macbuild/modules/objdetect && /home/usrname/.linuxbrew/Cellar/cmake/3.6.0/bin/cmake -E cmake_symlink_library ../../lib/libopencv_objdetect.so.2.4.13 ../../lib/libopencv_objdetect.so.2.4 ../../lib/libopencv_objdetect.so
make[2]: Leaving directory '/tmp/opencv-20160725-28945-vyl9j5/opencv-2.4.13/macbuild'
[ 44%] Built target opencv_objdetect
make[1]: Leaving directory '/tmp/opencv-20160725-28945-vyl9j5/opencv-2.4.13/macbuild'
make: *** [Makefile:164: all] Error 2
READ THIS: https://github.com/Linuxbrew/brew/blob/master/share/doc/homebrew/Troubleshooting.md#troubleshooting
If reporting this issue please do so at (not Homebrew/brew):
https://github.com/Homebrew/homebrew-science/issues
These open issues may also help:
That's all.

Qt error: c: command not found / qmake could not locate g++ compiler

I have 2 versions of SDK for Qt Creator: Compiled from Open Source and Compiled from bitbake.
The Open Source SDK is working fine, but the bitbake one is having trouble recognizing the compiler. I have added the g++ compiler to build & Run and source environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabias well.
make: c: Command not found make: [moc_utils.o] Error 127 (ignored)
make:
Wl,-rpath-link,/opt/poky/charles/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/lib:
Command not found make: [quicknanobrowser] Error 127 (ignored)
Here is the error one Compiler Log:
14:27:55: Running steps for project quicknanobrowser...
14:27:55:
Starting:
"/opt/poky/charles/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qmake"
/home/hbulab/Qt5.5.1/Examples/Qt-5.5/webengine/quicknanobrowser/quicknanobrowser.pro
-r -spec linux-oe-g++ CONFIG+=debug CONFIG+=declarative_debug CONFIG+=qml_debug
14:27:55: The process
"/opt/poky/charles/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qmake"
exited normally.
14:27:55: Starting: "/usr/bin/make"
c -pipe -g
-DLINUX=1 -DEGL_API_FB=1 -Wall -W -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_WEBENGINE_LIB -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I.
and here is the one without error, we could see that the make could not find the g++ compiler. How do I fix it?
14:29:08: Running steps for project quicknanobrowser... 14:29:08:
Starting: "/opt/hio-imx6dl-board/opt/Qt5daisy/bin/qmake"
/home/hbulab/Qt5.5.1/Examples/Qt-5.5/webengine/quicknanobrowser/quicknanobrowser.pro
-r -spec devices/linux-imx6-g++ CONFIG+=debug CONFIG+=declarative_debug CONFIG+=qml_debug
14:29:09: The process
"/opt/hio-imx6dl-board/opt/Qt5daisy/bin/qmake" exited normally.
14:29:09: Starting: "/usr/bin/make"
/opt/poky/1.6.1/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++
-c -pipe -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1 -mfloat-abi=hard -g -Wall -W -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_WEBENGINE_LIB -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I.
MakeFile Information:
MAKEFILE = Makefile
####### Compiler, tools and options
CC = $(OE_QMAKE_CC)
CXX = $(OE_QMAKE_CXX)
DEFINES = -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_WEBENGINE_LIB -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB
CFLAGS = -pipe $(OE_QMAKE_CFLAGS) -g -DLINUX=1 -DEGL_API_FB=1 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
CXXFLAGS = -pipe $(OE_QMAKE_CXXFLAGS) -g -DLINUX=1 -DEGL_API_FB=1 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
INCPATH = -I../../../Qt5.5.1/Examples/Qt-5.5/webengine/quicknanobrowser -I. -isystem /opt/poky/charles/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5 -isystem /opt/poky/charles/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtWebEngine -isystem /opt/poky/charles/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtQuick -isystem /opt/poky/charles/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtWidgets -isystem /opt/poky/charles/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtGui -isystem /opt/poky/charles/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtQml -isystem /opt/poky/charles/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtNetwork -isystem /opt/poky/charles/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtCore -I. -I/opt/poky/charles/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/linux-oe-g++
QMAKE = /opt/poky/charles/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qmake
As ${OE_QMAKE_CXX} is empty, that indicates to me that you haven't source environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabiasenvironment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi.
This should work to compile by hand:
. /opt/poky/charles/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi
echo $OE_QMAKE_CXX
qmake
make
(Assuming you don't need to pass any extra arguments to qmake).
Then do the following:
. /opt/poky/charles/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi
echo $OE_QMAKE_CXX
qtcreator
Note that you should start qtcreator from the same shell that you source environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi in.
This should get you going. Otherwise I'd suggest starting by getting a small, simple Qt appliction building correctly.
For more in configuring QtCreator, you could for instance have a look at how to setup QtCreator for cross-compilation.
Update
As it seems that Qt5 isn't included in the SDK at all, we first have to generate a suitable SDK. My preferred way:
bitbake your-image -c populate_sdk
This works, as long as your image recipe includes
inherit populate_sdk_qt5
That would give you an SDK, whose sysroot would match your image.
The "older" way, is to use a special toolchain recipe. For Qt5 that would be meta-toolchain-qt5, or some recipe that includes/requires that one. In this case, you would run:
bitbake meta-toolchain-qt5
Though, the recommended way is to use the image specific SDK.

Linking Rcpp to interp2d (GSL-type library)

I need some help with a linker error I get during installation of an Rcpp package on a linux system where I don't have admin rights. In a nutshell, I get this error:
relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
I have a file solve.cpp that uses external library interp2d, which in turn has a GSL dependency. I specify my dependencies via [[Rcpp::depends(RcppArmadillo,RcppGSL)]] and in the DESCRIPTION. My Makevars is like the one from the RcppGSL package, with the addition of the linterp2d flag:
PKG_CPPFLAGS = -W $(GSL_CFLAGS) $(LOCAL_INCLUDE)
PKG_LIBS += $(GSL_LIBS) $(LOCAL_LIBS) -linterp2d $(RCPP_LDFLAGS)
where I define the environement variables
export LOCAL_INCLUDE="-I/data/uctpfos/local/include/"
export LOCAL_LIBS="-L/data/uctpfos/local/lib/"
on the system.
I do R CMD INSTALL bkPackage and see:
g++ -I/cm/shared/apps/R/3.0.1/lib64/R/include -DNDEBUG -W -I/cm/shared/apps/gsl/1.15/include -I/data/uctpfos/local/include -fPIC -I/usr/local/include -I"/data/uctpfos/R/x86_64-unknown-linux-gnu-library/3.0/Rcpp/include" -I"/data/uctpfos/R/x86_64-unknown-linux-gnu-library/3.0/RcppArmadillo/include" -I"/data/uctpfos/R/x86_64-unknown-linux-gnu-library/3.0/RcppGSL/include" -fpic -O3 -fPIC -c RcppExports.cpp -o RcppExports.o
g++ -I/cm/shared/apps/R/3.0.1/lib64/R/include -DNDEBUG -W -I/cm/shared/apps/gsl/1.15/include -I/data/uctpfos/local/include -fPIC -I/usr/local/include -I"/data/uctpfos/R/x86_64-unknown-linux-gnu-library/3.0/Rcpp/include" -I"/data/uctpfos/R/x86_64-unknown-linux-gnu-library/3.0/RcppArmadillo/include" -I"/data/uctpfos/R/x86_64-unknown-linux-gnu-library/3.0/RcppGSL/include" -fpic -O3 -fPIC -c solve.cpp -o solve.o
The problems appears after that in the linking step:
g++ -shared -L/usr/local/lib64 -o bkPackage.so RcppExports.o solve.o -L/cm/shared/apps/gsl/1.15/lib -lgsl -lgslcblas -lm -L/data/uctpfos/local/lib -linterp2d -L/data/uctpfos/R/x86_64-unknown-linux-gnu-library/3.0/Rcpp/lib -lRcpp -Wl,-rpath,/data/uctpfos/R/x86_64-unknown-linux-gnu-library/3.0/Rcpp/lib
The error follows as:
/usr/bin/ld: /data/uctpfos/local/lib/libinterp2d.a(interp2d_spline.c.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/data/uctpfos/local/lib/libinterp2d.a: could not read symbols: Bad value
As you can see I compiled this with -fPIC, so that can't be it.
It's complaining that libinterp2d.a was not compiled with -fPIC; are you sure that was also compiled with -fPIC on?
Also, it seems you both have -fpic and -fPIC in your flags; you probably just want -fPIC. I think R actually ensures that's on by default.

Resources