1
그래서 SFML을 통해 스레드를 만들려고 노력하고 있지만 내 코드는 몇 시간 동안 수정하려고 시도한 오류를 생성하고 있습니다. 그래서 내가 필요하면 수정 또는 내 스레드 코드오류를 만드는 SFML의 스레드
#include "Thread.h"
Thread::Thread(void)
{
threadRunning = false;
}
ThreadException::ThreadException(string err)
{
this->err = err;
}
void Thread::Begin()
{
if(threadRunning == true) {
throw ThreadException("Thread already running");
}
threadRunning = true;
sf::Thread thread = (&Thread::ThreadProc, this);
thread.launch();
}
bool Thread::IsRunning()
{
return threadRunning;
}
Thread.cpp
#pragma once
#include <SFML\System.hpp>
#include <iostream>
using namespace std;
class Thread
{
private:
bool threadRunning;
public:
void Begin();
Thread();
bool IsRunning();
void ThreadProc();
};
class ThreadException : public exception
{
public:
const char * what() const throw()
{
return "Thread Exception";
}
std::string err;
ThreadException(string err);
~ThreadException() throw() {};
};
d:\c++\engine\deps\sfml-2.1\include\sfml\system\thread.inl(39): error C2064: term does not evaluate to a function taking 0 arguments
1> d:\c++\engine\deps\sfml-2.1\include\sfml\system\thread.inl(39) : while compiling class template member function 'void sf::priv::ThreadFunctor<T>::run(void)'
1> with
1> [
1> T=Thread *
1> ]
1> d:\c++\engine\deps\sfml-2.1\include\sfml\system\thread.inl(70) : see reference to class template instantiation 'sf::priv::ThreadFunctor<T>' being compiled
1> with
1> [
1> T=Thread *
1> ]
1> d:\c++\engine\src\engine\thread.cpp(20) : see reference to function template instantiation 'sf::Thread::Thread<Thread*>(F)' being compiled
1> with
1> [
1> F=Thread *
1> ]
그리고 여기에 있습니다 :
이
내가 점점 계속 오류입니다 여기에 무슨 일이 일어나고 있는지에 대한 설명은 문자 그대로 내가 이것을 고칠 수있는 모든 것을 시도했다.