Hi, I'm a somewhat new used to code::blocks, and I just have a question regarding a compilation error I'm getting. I'm compiling using the MS Visual C++ 2005/2008 compiler (hence the pragmas) and I'm getting an error when I use:
#if PLATFORM == PLATFORM_WINDOWS
void wait( float seconds )
{
Sleep( (int) ( seconds * 1000.0f ) );
}
#else
#include <unistd.h>
void wait( float seconds ) { usleep( (int) ( seconds * 1000000.0f ) ); }
#endif
and the error I'm getting is that there are multiple definitions of the method wait. Obviously (maybe not?) it sees both of those statements and automatically thinks they are duplicates.
For a little more info, this is a sample code for learning to use sockets and some basic networking protocols. The project is http://www.gafferongames.com/networking-for-game-programmers/sending-and-receiving-packets/ and it's listed in a link under example program. Thanks in advance for the help! It's probably an easy fix :)