Beaglebone and Angstrom, C++, threads

Hello everyone,

*Note: I posted previously asking my question but I realized I had to fill out the “Categories” after I clicked “POST” and I couldn’t find my original post anywhere so I apologize if this gets posted twice.

I have been having issues with C++ and threads on Angstrom. I currently have the latest Angstrom release for Beaglebone and kernel 3.2.42.

So, I have tried compiling (this example here http://www.cplusplus.com/reference/thread/thread/) with the various combination of -pthread, -lpthread, -std=c++0x, -std=c++11, and I always get this error: “pure virtual method called; terminate called without an active exception;Aborted”, when running the executable.

I looked around and it seems g++ v4.7+ solves this problem so I decided to cross compile for ARM using my Ubuntu Desktop. So, after setting up all the necessary options with ARM cross compilation (using cross compile g++ v4.7.2) on Eclipse, the same issue occurred.

Has anyone gotten threads with C++ to work on Angstrom? If so, or if you have a solution to my problem, could you please direct me to the right direction?

Thank you so much.

Register and your posts go through. Don’t and they are moderated and will not be posted until approved.

Gerald

Try this, it worked for me

g++ -D__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 -D__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 -D__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 -D__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 -std=c++11 test.cpp -pthread

I dont know where I found this, it was through google searches though.

Carl

Hello everyone,

*Note: I posted previously asking my question but I realized I had to fill out the “Categories” after I clicked “POST” and I couldn’t find my original post anywhere so I apologize if this gets posted twice.

I have been having issues with C++ and threads on Angstrom. I currently have the latest Angstrom release for Beaglebone and kernel 3.2.42.

So, I have tried compiling (this example here http://www.cplusplus.com/reference/thread/thread/) with the various combination of -pthread, -lpthread, -std=c++0x, -std=c++11, and I always get this error: “pure virtual method called; terminate called without an active exception;Aborted”, when running the executable.

I looked around and it seems g++ v4.7+ solves this problem so I decided to cross compile for ARM using my Ubuntu Desktop. So, after setting up all the necessary options with ARM cross compilation (using cross compile g++ v4.7.2) on Eclipse, the same issue occurred.

Has anyone gotten threads with C++ to work on Angstrom? If so, or if you have a solution to my problem, could you please direct me to the right direction?

I got threads to work using the “boost” libraries.