Of + boost on raspberry pi 2

Hi,

I have an of-application depending on boost that was developed on Windows with Visual Studio 12. Now I want this application to run on a Raspberry Pi 2. The pi was setup as described in the tutorial. Simple applications as well as the demos run fine. But my own application doesn’t compile.

Since I’m not expererienced with the make system I doubt that the make file is entirely correct. Or that boost is installed and setup on the pi correctly. The config.make file was updated to use the g+±4.8 compiler and c++ 11 features via PROJECT_CFLAGS. The following is my attempt to link the boost directory:

PROJECT_EXTERNAL_SOURCE_PATH = /home/pi/boost158

With these settings I get the follwoing error: g++-4.8: error trying to exec '/usr/lib/gcc/arm-linux-gnueabihf/4.8/cc1plus': execv: Argument list too long

Without the boost path in the make file the compiler fails with errors such as undefined reference to 'boost::system...'.

What ist the best way to install the latest boost version (I use 1.58) on Raspbian? And what should th make file look like?

with the oF make system you can also just put any library into /src/libs/ and include them with PROJECT_LDFLAGS += -lLibraryFolderName. in the config.make you should usually find in the root of your project folder (if you used the project template for the rpi)

For how to install boost: http://www.boost.org/doc/libs/1_58_0/more/getting_started/unix-variants.html

Thanks you for your quick response.

So, I take the ‘OF Empty Example Project’ and I compiled it with make and make run. It works.

Then I added the following code…

#include 
#include 
#include 
#include 

int main()
{
    using namespace boost::lambda;
    typedef std::istream_iterator in;

    std::for_each(
        in(std::cin), in(), std::cout << (_1 * 3) << " " );
}

in the main.

I downloaded boost from here http://www.boost.org/doc/libs/1_58_0/more/getting_started/unix-variants.html

I drop the folder in the path: /home/pi/openframeworks/of_v0.8.4_linuxarmv7l_release/apps/myApps/emptyExample/src/libs/boost_1_58_0

I added the following line in the make.config:

 PROJECT_LDFLAGS += -lboost_1_58_0

I compile it again with make

I get the same error like:

/../../libs/openFrameworks/graphics -I../../../libs/openFrameworks/gl -I../../../libs/openFrameworks/video -I../../../libs/openFrameworks/events -I../../../libs/openFrameworks/3d -I../../../libs/openFrameworks/utils -I../../../libs/openFrameworks/math  -MMD -MP -MF obj/linuxarmv7l/Release/src/ofApp.d -MT obj/linuxarmv7l/Release/src/ofApp.o -o obj/linuxarmv7l/Release/src/ofApp.o -c src/ofApp.cpp
g++: error trying to exec '/usr/lib/gcc/arm-linux-gnueabihf/4.6/cc1plus': execv: Die Argumentliste ist zu lang
g++: error trying to exec 'as': execvp: Die Argumentliste ist zu lang
../../../libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:191: recipe for target 'obj/linuxarmv7l/Release/src/ofApp.o' failed
make[1]: *** [obj/linuxarmv7l/Release/src/ofApp.o] Error 1
make[1]: *** wait: Keine Kind-Prozesse.  Schluss.
../../../libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:126: recipe for target 'Release' failed
make: *** [Release] Error 2

What I made wrong? I tried a lot in the last week, but I failed always with this dawm error. Please help :blush:

Well that output says it tried to compile with gcc 4.6. You might want to update the symbolic link for gcc to always use gcc 4.8.

ln -s /usr/bin/gcc-4.8 /usr/bin/gcc
ln -s /usr/bin/g++-4.8 /usr/bin/g++

Other than that your german locale might cause unknown issues with the scripts or your environment variable is too long. In any of those cases just try a fresh raspbian image and don’t do anything to it besides apt-get update && upgrade, setting up oF and updating the gcc symlink.