Note that there are some explanatory texts on larger screens.

plurals
  1. POCross-compiling C++11 code for Raspberry Pi
    text
    copied!<p>I'm trying to port a large project, which makes heavy use of C++11 features, to the Raspberry Pi. The project uses CMAKE and I'm using crosstool-ng for the cross-compiling. I installed dependencies on the Pi and copied them locally, and I've managed to get CMAKE to find those. Some of the code builds properly and produces ARM output. However, most of the code fails with confusing GCC output that I'm pretty sure has to do with C++11/template support. For example, I get errors like this:</p> <ul> <li><p><code>error: 'mutex' in namespace 'std' does not name a type</code> (the file in question includes &lt;thread&gt; and this error goes away if I also include &lt;mutex&gt;, not a requirement on x86 Ubuntu)</p></li> <li><p><code>error: expected class-name before '{' token</code> (the line before { is: <code>template&lt;typename _Res&gt; class __basic_future : public std::__future_base</code>)</p></li> <li><p><code>error: '__result_type' does not name a type</code> (this probably happens because of the error above)</p></li> </ul> <p>These errors look like the ARM g++ compiler just doesn't like templates that much. The version of g++ being used is <code>arm-unknown-linux-gnueabi-g++ (crosstool-NG 1.18.0) 4.7.3 20130102 (prerelease)</code>.</p> <p>Can anyone point me in the right direction?</p> <p>Edit: Here's what g++ looks like for one of the files in <code>ps</code>:</p> <pre><code>arm-unknown-linux-gnueabi-g++ -DprojectCore_EXPORTS -fPIC -I/home/sagar/workspace/RaspberryPi/target_env/usr/include -I/home/sagar/workspace/RaspberryPi/target_env/usr/include/freetype2 -I/home/sagar/workspace/RaspberryPi/target_env/usr/include/glib-2.0 -I/home/sagar/workspace/RaspberryPi/target_env/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/home/sagar/workspace/RaspberryPi/target_env/usr/include/gdk-pixbuf-2.0 -I/home/sagar/workspace/RaspberryPi/target_env/usr/include/gtk-2.0 -I/home/sagar/workspace/RaspberryPi/target_env/usr/lib/arm-linux-gnueabihf/gtk-2.0/include -I/home/sagar/workspace/RaspberryPi/target_env/usr/include/cairo -I/home/sagar/workspace/RaspberryPi/target_env/usr/include/pango-1.0 -I/home/sagar/workspace/RaspberryPi/target_env/usr/include/atk-1.0 -I/home/sagar/workspace/RaspberryPi/target_env/usr/local/include -I/home/sagar/workspace/RaspberryPi/target_env/usr/include/eigen3 -I/home/sagar/workspace/RaspberryPi/target_env/usr/include/flann -I/home/sagar/workspace/project/include -std=c++0x -Wall -Werror -Wno-deprecated -fPIC -g -O4 -o CMakeFiles/projectCore.dir/src/project/Core/Memory/Array2D.C.o -c /home/sagar/workspace/project/src/project/Core/Memory/Array2D.C </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload