qmake adds /usr/lib absolute path when cross compiling - qt

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.

Related

How to build QT Project from terminal MacOS X

For example, lets take a default QT widget application that we get. So instead of using QT Creator if we want to build using the terminal then what is the way to do that?
Basically we want to produce the build for the project which actually also contains the dmg file.
Compile output when done using QT Creator shown is below when no change is done :
14:37:04: Running steps for project QTDefaultProj...
14:37:04: Configuration unchanged, skipping qmake step.
14:37:04: Starting: "/usr/bin/make"
make: Nothing to be done for `first'.
14:37:05: The process "/usr/bin/make" exited normally.
14:37:05: Elapsed time: 00:00.
Compile Output after changing the directory :
15:31:50: Running steps for project QTDefaultProj...
15:31:50: Starting: "/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/bin/qmake" /Users/arqam/Desktop/Junk/QTDefaultProj/QTDefaultProj.pro -spec macx-clang CONFIG+=debug CONFIG+=x86_64 CONFIG+=qml_debug
Info: creating stash file /Users/arqam/Desktop/Junk/build-QTDefaultProj-Desktop_Qt_5_10_0_clang_64bit-Debug-2/.qmake.stash
15:31:50: The process "/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/bin/qmake" exited normally.
15:31:50: Starting: "/usr/bin/make" qmake_all
make: Nothing to be done for `qmake_all'.
15:31:51: The process "/usr/bin/make" exited normally.
15:31:51: Starting: "/usr/bin/make"
/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/bin/uic ../QTDefaultProj/mainwindow.ui -o ui_mainwindow.h
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -std=gnu++11 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.10 -Wall -W -fPIC -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../QTDefaultProj -I. -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtWidgets.framework/Headers -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtGui.framework/Headers -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AGL.framework/Headers -I. -I../../ImageToCartoon/QT/5.10.0/clang_64/mkspecs/macx-clang -F/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib -o main.o ../QTDefaultProj/main.cpp
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -std=gnu++11 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.10 -Wall -W -fPIC -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../QTDefaultProj -I. -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtWidgets.framework/Headers -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtGui.framework/Headers -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AGL.framework/Headers -I. -I../../ImageToCartoon/QT/5.10.0/clang_64/mkspecs/macx-clang -F/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib -o mainwindow.o ../QTDefaultProj/mainwindow.cpp
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -pipe -stdlib=libc++ -g -std=gnu++11 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.10 -Wall -W -dM -E -o moc_predefs.h ../../ImageToCartoon/QT/5.10.0/clang_64/mkspecs/features/data/dummy.cpp
/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/bin/moc -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB --include ./moc_predefs.h -I/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/mkspecs/macx-clang -I/Users/arqam/Desktop/Junk/QTDefaultProj -I/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib/QtWidgets.framework/Headers -I/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib/QtGui.framework/Headers -I/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.1.0/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include -F/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib ../QTDefaultProj/mainwindow.h -o moc_mainwindow.cpp
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -std=gnu++11 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.10 -Wall -W -fPIC -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../QTDefaultProj -I. -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtWidgets.framework/Headers -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtGui.framework/Headers -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AGL.framework/Headers -I. -I../../ImageToCartoon/QT/5.10.0/clang_64/mkspecs/macx-clang -F/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib -o moc_mainwindow.o moc_mainwindow.cpp
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -stdlib=libc++ -headerpad_max_install_names -arch x86_64 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.10 -Wl,-rpath,#executable_path/Frameworks -Wl,-rpath,/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib -o QTDefaultProj.app/Contents/MacOS/QTDefaultProj main.o mainwindow.o moc_mainwindow.o -F/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib -framework QtWidgets -framework QtGui -framework QtCore -framework DiskArbitration -framework IOKit -framework OpenGL -framework AGL
15:31:55: The process "/usr/bin/make" exited normally.
15:31:55: Elapsed time: 00:05.
With help from m7913d I am finally able to build the QT project from terminal without using QT Creator.
So steps are :
Create an empty folder name it as build-debug for example.
Inside your build-debug folder run the following command :
pathToQTDirectory/QT/5.10.0/clang_64/bin/qmake pathToQTProjectFolder/MyProject/
/usr/bin/make qmake_all
/usr/bin/make
If the above doesn't work then try seeing in the QT Creator compiler output the steps involved when you specify a new directory as the build directory.

How to disable C++11 in qmake?

Project file:
CONFIG -= qt
QMAKE_CXXFLAGS += -std=c++98
QMAKE_CXXFLAGS -= -std=c++11
QMAKE_CXXFLAGS -= -std=gnu++11
CONFIG -= c++11
Result:
g++ -c -pipe -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-but-set-variable -Wno-reorder -Wno-missing-field-initializers -std=c++98 -DDEBUG -g -std=gnu++11 -Wall -W -fPIC -DQT_QML_DEBUG -I../../qqq -I. -I../src/jsoncpp -I../lib -I../../../../Qt/5.9.1/gcc_64/mkspecs/linux-g++ -o ../build/debug/obj/TaskManager.o ../src/TaskManager.cpp
g++ -c -pipe -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-but-set-variable -Wno-reorder -Wno-missing-field-initializers -std=c++98 -DDEBUG -g -std=gnu++11 -Wall -W -fPIC -DQT_QML_DEBUG -I../../qqq -I. -I../src/jsoncpp -I../lib -I../../../../Qt/5.9.1/gcc_64/mkspecs/linux-g++ -o ../build/debug/obj/Utils.o ../src/Utils.cpp
As you see option -std=gnu++11 still exist (no any reactoion to "QMAKE_CXXFLAGS -="/"CONFIG -=").
Qt:
Qt Creator 4.3.1
Based on Qt 5.9.1 (GCC 5.3.1 20160406 (Red Hat 5.3.1-6), 64 bit)
Built on Jun 29 2017 04:10:39
Thank you a lot.
P.S. I have compatibility troubles with gnu++11 (c++ with gcc extenstions) on clean system
./qqq: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by ./qqq)
./qqq: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ./qqq)
./qqq: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21' not found
and want to use c++11 (c++ without gcc extenstions) instead gnu++11 without any extenstions but I cannot to disable it :-(

Can not use C++11 in Qt

Since Qt 5.7, C++11 support is mandatory. For some reason one large old project does not accept the C++11 arguments. It doesn't matter if I use "CONFIG += c++11" or any other; C++11 only features do not work and therefor I can not compile the project.
C:\QtE\5.7\android_armv7\include\QtCore\qbasicatomic.h:61: error:
error "Qt requires C++11 support"
^
The compiler arguments do contain "-std=c++11 -std=c++0x" if I use "CONFIG += c++11" in the .pro file. The target platform is Android ArmV7. SDK R24 and NDK R10E are used.
C:\SDKs\Android\android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/windows/bin/arm-linux-androideabi-g++ -c -Wno-psabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -DANDROID -Wa,--noexecstack -fno-builtin-memmove -std=c++11 -fPIC -ansi -fpermissive -finline-functions -Wno-long-long -g -g -marm -O0 -fno-omit-frame-pointer -O2 -Wall -Wno-psabi -W -D_REENTRANT -fPIC -DPJ_IS_LITTLE_ENDIAN=1 -DPJ_IS_BIG_ENDIAN=0 -DQZXING_LIBRARY -DZXING_ICONV_CONST -DDISABLE_LIBRARY_FEATURES -DNOFMAXL -DBOTAN_DLL=Q_DECL_EXPORT -DBOTAN_TARGET_OS_HAS_GETTIMEOFDAY -DBOTAN_HAS_ALLOC_MMAP -DBOTAN_HAS_ENTROPY_SRC_DEV_RANDOM -DBOTAN_HAS_ENTROPY_SRC_EGD -DBOTAN_HAS_ENTROPY_SRC_FTW -DBOTAN_HAS_ENTROPY_SRC_UNIX -DBOTAN_HAS_MUTEX_PTHREAD -DBOTAN_HAS_PIPE_UNIXFD_IO -DBOTAN_TARGET_OS_IS_LINUX -DBOTAN_TARGET_OS_HAS_CLOCK_GETTIME -DBOTAN_TARGET_OS_HAS_DLOPEN -DBOTAN_TARGET_OS_HAS_GMTIME_R -DBOTAN_TARGET_OS_HAS_POSIX_MLOCK -DBOTAN_HAS_DYNAMICALLY_LOADED_ENGINE -DBOTAN_HAS_DYNAMIC_LOADER -DBOTAN_BUILD_COMPILER_IS_GCC -DQT_QML_DEBUG -DQT_QUICKWIDGETS_LIB -DQT_WIDGETS_LIB -DQT_QUICK_LIB -DQT_MULTIMEDIA_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_WEBSOCKETS_LIB -DQT_NETWORK_LIB -DQT_POSITIONING_LIB -DQT_ANDROIDEXTRAS_LIB -DQT_CORE_LIB
Any idea is welcome :)
According to this questions accepted answer, It says CONFIG += c++11 requires Qt 5. Are you sure you are using Qt 5?
Also, It also says if you use gcc/clang you should use QMAKE_CXXFLAGS += -std=c++11 (or QMAKE_CXXFLAGS += -std=c++0x).
since you are building an android project, it will use gcc. Change CONFIG += c++11 to QMAKE_CXXFLAGS += -std=c++11 and tell me what happened.
One of the .pri sub-projects used the argument "-ansi" which is equivalent to "-std=c++98". This prevents the compilation with C++11.
Thanks to Oktalist for the solution comment :)

RInside and Rcpp in c++x11

I would like to use RInside in a c++x11 code to call R routine. By default, R seems to install a c++98 version of the library and thus the linking does not success. I wonder what are the different steps I should proceed to install c++x11 version of RInside (but I guess that I need to recompile all R/R package, is it ?) and if some more simple solution exists. Thanks in advance (I work on MacOs)
Update:
I reinstalled Rcpp and RInside doing (my Makevars is empty so c++98 version)
sudo R CMD INSTALL ~/Downloads/Rcpp_0.10.4.tar.gz
sudo R CMD INSTALL ~/Downloads/RInside_0.2.10.tar.gz
Then I compile the hello world example using (no cx11) :
clang++ -I/Library/Frameworks/R.framework/Versions/2.15/Headers/ -I/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RInside/include/ -I/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include/ -c ../src/Gui/test.cc -o testOut.cc.o
clang++ testOut.cc.o -o testOut -L/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RInside/lib/x86_64 -L/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/lib/x86_64 -framework R -lRInside -lRcpp
That produces me:
Hello, world!
However, by adding the x11 option:
clang++ -I/Library/Frameworks/R.framework/Versions/2.15/Headers/ -I/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RInside/include/ -I/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include/ -c ../src/Gui/test.cc -o testOut.cc.o -stdlib=libc++ -std=c++11
clang++ testOut.cc.o -o testOut -L/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RInside/lib/x86_64 -L/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/lib/x86_64 -framework R -lRInside -lRcpp -stdlib=libc++ -std=c++11
I get (when linking):
Undefined symbols for architecture x86_64:
"RInside::parseEvalQ(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
_main in testOut.cc.o
"RInside::operator[](std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
_main in testOut.cc.o
"Rcpp::Environment::assign(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, SEXPREC*) const", referenced from:
bool Rcpp::Environment::assign<char [15]>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const (&) [15]) const in testOut.cc.o
When recompiling Rcpp and RInside using c++x11 options
clang++ -I/Library/Frameworks/R.framework/Versions/2.15/Headers/ -I/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RInside/include/ -I/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include/ -c ../src/Gui/test.cc -o testOut.cc.o -stdlib=libc++ -std=c++11
clang++ testOut.cc.o -o testOut -L/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RInside/lib/x86_64 -L/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/lib/x86_64 -framework R -lRInside -lRcpp -stdlib=libc++ -std=c++11
liking is ok but ./test gives me a seg fault.
Add: my clang version is : Apple clang version 4.1 (tags/Apple/clang-421.11.66)
R is compiled with a c compiler. You don't necessarily need to use the same to build packages. So it is perfectly valid to use clang to compile add on packages. I have this in my ~/.R/Makevars file to use clang and C++11 for package:
CC=clang
CXX=clang++
CXXFLAGS= -stdlib=libc++ -std=c++11
Also, you might want to have a look at Rcpp11, a C++11 centric redesign of Rcpp. It probably would not be too hard to fork RInside to use Rcpp11 instead of Rcpp.
I am not aware of different linker requirements. What you have should just work. Otherwise please show your actual linking steps and errors, preferably in a reproducible way I could look at at my end too.
Witness the following. We first build with default flags:
edd#max:~/svn/rinside/pkg/inst/examples/standard$ grep ^CXXFLAGS ~/.R/Makevars
CXXFLAGS= -g -O3 -Wall -pipe -Wno-unused -pedantic # plain C++
edd#max:~/svn/rinside/pkg/inst/examples/standard$ make rinside_sample0
ccache g++-4.7 -I/usr/share/R/include \
-I/usr/local/lib/R/site-library/Rcpp/include \
-I/usr/local/lib/R/site-library/RInside/include -g -O3 -Wall \
-pipe -Wno-unused -pedantic -Wall \
rinside_sample0.cpp -L/usr/lib/R/lib -lR -lblas \
-llapack -L/usr/local/lib/R/site-library/Rcpp/lib -lRcpp \
-Wl,-rpath,/usr/local/lib/R/site-library/Rcpp/lib \
-L/usr/local/lib/R/site-library/RInside/lib \
-lRInside -Wl,-rpath,/usr/local/lib/R/site-library/RInside/lib \
-o rinside_sample0
edd#max:~/svn/rinside/pkg/inst/examples/standard$ ./rinside_sample0
Hello, world!
edd#max:~/svn/rinside/pkg/inst/examples/standard$
Now I am simply adding -std=c++11 to my CXXFLAGS:
edd#max:~/svn/rinside/pkg/inst/examples/standard$ grep ^CXXFLAGS ~/.R/Makevars
CXXFLAGS= -g -O3 -Wall -pipe -Wno-unused -pedantic -std=c++11
edd#max:~/svn/rinside/pkg/inst/examples/standard$
and remake the binary:
edd#max:~/svn/rinside/pkg/inst/examples/standard$ rm rinside_sample0
edd#max:~/svn/rinside/pkg/inst/examples/standard$ make rinside_sample0
ccache g++-4.7 -I/usr/share/R/include \
-I/usr/local/lib/R/site-library/Rcpp/include \
-I/usr/local/lib/R/site-library/RInside/include \
-g -O3 -Wall -pipe -Wno-unused \
-pedantic -std=c++11 -Wall \
rinside_sample0.cpp -L/usr/lib/R/lib -lR \
-lblas -llapack -L/usr/local/lib/R/site-library/Rcpp/lib -lRcpp \
-Wl,-rpath,/usr/local/lib/R/site-library/Rcpp/lib \
-L/usr/local/lib/R/site-library/RInside/lib \
-lRInside -Wl,-rpath,/usr/local/lib/R/site-library/RInside/lib \
-o rinside_sample0
edd#max:~/svn/rinside/pkg/inst/examples/standard$ ./rinside_sample0
Hello, world!
edd#max:~/svn/rinside/pkg/inst/examples/standard$
To deploy C++11, you do not need a new compiler or project.
Just add a single option to your compiler flags -- it is that easy.
And just to make it more plain, we can also add these three lines to rinside_sample0.cpp to make it a C++11 program:
auto magic = 42; // C++11
R["magic"] = magic;
R.parseEvalQ("print(magic)");
and (with the required -std=c++11 flag) it too builds and runs. Stricly no change required at the Rcpp or RInside end to deploy them with a C++11-capable compiler.

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