Salut, je voudrais appeler un thread mais j'ai un problème en compilation :
Listener(bool useThread=false) : m_thread(&Listener::run) {
if (useThread) {
m_thread.launch();
}
}
void run() {
running = true;
while (running) {
processEvents();
}
}
void stop() {
running = false;
}
C:/Users/Laurent/Windows/ODFAEG/extlibs/headers/SFML/System/Thread.inl: In instantiation of 'void sf::priv::ThreadFunctor<T>::run() [with T = void (odfaeg::core::Listener::*)()]':
C:\Users\Laurent\Windows\ODFAEG\src\odfaeg\Core\application.cpp:8:1: required from here
C:/Users/Laurent/Windows/ODFAEG/extlibs/headers/SFML/System/Thread.inl:39:25: error: must use '.*' or '->*' to call pointer-to-member function in '((sf::priv::ThreadFunctor<void (odfaeg::core::Listener::*)()>*)this)->sf::priv::ThreadFunctor<void (odfaeg::core::Listener::*)()>::m_functor (...)', e.g. '(... ->* ((sf::priv::ThreadFunctor<void (odfaeg::core::Listener::*)()>*)this)->sf::priv::ThreadFunctor<void (odfaeg::core::Listener::*)()>::m_functor) (...)'
virtual void run() {m_functor();}
^
src\odfaeg\Core\CMakeFiles\odfaeg-core.dir\build.make:90: recipe for target 'src/odfaeg/Core/CMakeFiles/odfaeg-core.dir/application.cpp.obj' failed
mingw32-make[2]: *** [src/odfaeg/Core/CMakeFiles/odfaeg-core.dir/application.cpp.obj] Error 1
CMakeFiles\Makefile2:236: recipe for target 'src/odfaeg/Core/CMakeFiles/odfaeg-core.dir/all' failed
mingw32-make[1]: *** [src/odfaeg/Core/CMakeFiles/odfaeg-core.dir/all] Error 2
Makefile:128: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
Et avec std::thread j'ai une autre erreur...