Jag försöker få ett c++ program att kompilera i ubuntu men den säger "Sleep was not declared in this scope". Programmet gick att kompilera helt utan problem i windows 7.
http://linux.die.net/man/3/sleep
sleep med litet s och du måste inkuldera unistd.h.
http://www.gamersdelight.eu/
Det löste problemet. Tack
använd preprocessorn direktiv för att använda platformspecifik kod vid kompilering.
#ifdef _WIN32 #include <windows.h> #else #include <unistd.h> #endif /.../ #ifdef _WIN32 Sleep(1000); #else sleep(1); #endif
Rocket Blast
Prylar säljes, köpes, bytes och skänkes