lundi 23 avril 2018

'runThread' was not declared in this scope.

I have a problem with that error and I literally have no idea how to solve this, how to call this function in main.cpp.

Snake.cpp

 void Snake::runThread(Snake* snake)
{
char c;
while(c != 'q'){
   timeout(50);
    c = getch();
    mx.lock();
    clear();
    drawBorder();
    snake->moveA();
    drawSnakes();
    refresh();
    mx.unlock();
}
}

main.cpp

int main() {



Snake *snake1;
Snake *snake2;

std::thread thread1 = std::thread(runThread, snake1);
std::thread thread2 = std::thread(runThreadB, snake2);

thread1.join();
thread2.join();

endwin();
return 0;
}

Aucun commentaire:

Enregistrer un commentaire