Q:

C++ Error on vector of objects containing threaded function

do you know of any method (C++) to create a vector of objects containing a threaded function?  Ideally the technique has to be crossplatform (Win/OSX) and easily portable to mobile (iOS).  It can be very basic multithreading, the function to be run in parallel is pretty simple (but computationally intensive). 
I am writing an application  with many objects (belonging to the same class) having a quite complex data structure which needs to be analysed in parallel: while the main application thread takes care of interacting with the user and rendering the scene, each object gets its data analysed in parallel on separate threads. 
So far I tried to prototype the app in OpenFrameworks (using ofThread), but as soon as I start creating a vector of objects containing a threaded function the compiler throws some weird errors (see below for reference). 
(OpenFrameworks example)
class MyClass: public ofThread
{
     int A, B, C;
     void threadedFunction();
     MyClass();
}

... if I instantiate the class (run its methods, including the threaded function) no problem.  
I then create a vector of this class:
// in main function
...
vector<MyClass> myList;

...  but now as soon as I try to add an instance of the class to the vector, the compiler fails saying that it cant access privte members in class Poco:FastMutex (utils\ofthread.h(190): error C2248: 'Poco::FastMutex::FastMutex' : cannot access private member declared in class 'Poco::FastMutex' and Poco:Thread (utils\ofthread.h(190): error C2248: 'Poco::Thread::Thread' : cannot access private member declared in class 'Poco::Thread')
// in main function
...
myList.push_back(MyClass());    //ERROR! 

. 
// in main function
...
MyClass temp;              //OK SO FAR
myList.push_back(temp);    //ERROR! 

Any help welcome! 

A:

You can't make a copy of a mutex.  Your push_back function tries to create a new instance of MyClass in the vector as a copy of temp.  You can use a vector of smart pointers instead.