Beaglebone, C++, and threads

Hello everyone,

I have been looking around and trying to find answers for my problem but I have yet to run into a solution.

So, I currently have the latest release of Angstrom for Beaglebone and I have the latest g++ for it (4.5.4 I believe but I would prefer to have 4.7.2). The kernel is 3.2.42 I believe.

I have coded the threading example here: http://www.cplusplus.com/reference/thread/thread/ and compiled with combinations of -pthread, -lpthread, -std=c++0x, and std=c++11 but I always get an error “pure virtual method called; terminate called without an active exception; Aborted”.

I have looked around and it seems that can be fixed by g++ v4.7+ so I decided to cross compile on my Ubuntu with g++ v4.7.2. I configured all the necessary things required to cross compile on ARM and deploy on Beaglebone but I either get the error of the one I mentioned or this “terminate called after throwing an instance of ‘std::system_error’; what():; Aborted”.

I have also looked around for that previous error but the suggested solutions for that error did not help me at all.

Has anyone gotten C++ and threading to work with Angstrom? If so, or if you know a solution to my issue, could you point me to the right direction?

Thank you so much.

This was written in eclipse and verified on the beagle bone black running angstrom v2013.09.04

/*

  • thread-test.cc

Almost forgot be sure to link with -lpthread.