Witam.
Mam taki kod klasy, która opakowuje wątki boost i wywołuje w swoim konstruktorze funkcję globalną usbRead widoczną jeszcze niżej:
ThreadEx::ThreadEx(UsbAPI *ptr, int stacksize, int parameter, void * reference, std::string threadName, bool stopFlag) {
if (!stackSize) {
stacksize = 4096*10;
}
if (stopFlag) {
cout << "Thread:" << threadName << "cannot start - stopFlag is 1" << endl;
} else {
this->stackSize = stacksize;
this->parameter = 42;
boost::thread_attributes attrs;
attrs.set_stack_size (this->stackSize);
boost::thread thrd1 (boost::bind(reference, ptr,threadName,stopFlag));
}
}
void usbRead(UsbAPI* usbObj, std::string threadName, bool stopFlag) {
cout << "Thread:"<<threadName << "has been started"<< endl;
while (!stopFlag) {
//ptr=usbObj->ReadPipe( );
/*if (!ptr) {
boundedBuffer->pushNewElements();
}*/
}
cout <<"Thread"<<threadName << "has been stoped"<< endl;
}
czym może być spowodowany błąd ??:
1>c:\boost_1_53_0\boost\bind\bind.hpp(69): error C2825: 'F': must be a class or namespace when followed by '::'
1> c:\boost_1_53_0\boost\bind\bind_template.hpp(15) : see reference to class template instantiation 'boost::_bi::result_traits<R,F>' being compiled
1> with
1> [
1> R=boost::_bi::unspecified,
1> F=void *
1> ]
1> c:\{ścieżka}: see reference to class template instantiation 'boost::_bi::bind_t<R,F,L>' being compiled
1> with
1> [
1> R=boost::_bi::unspecified,
1> F=void *,
1> L=boost::_bi::list3<boost::_bi::value<UsbAPI *>,boost::_bi::value<std::string>,boost::_bi::value<bool>>
1> ]
1>c:\boost_1_53_0\boost\bind\bind.hpp(69): error C2039: 'result_type' : is not a member of '`global namespace''
1>c:\boost_1_53_0\boost\bind\bind.hpp(69): error C2146: syntax error : missing ';' before identifier 'type'
1>c:\boost_1_53_0\boost\bind\bind.hpp(69): error C2208: 'boost::_bi::type' : no members defined using this type
1>c:\boost_1_53_0\boost\bind\bind.hpp(69): fatal error C1903: unable to recover from previous error(s); stopping compilation
Będę wdzięczny za pomoc :)