Code::Blocks Forums

User forums => Help => Topic started by: devinp52 on April 19, 2011, 04:04:26 am

Title: Statement not recognized (or not correctly)
Post by: devinp52 on April 19, 2011, 04:04:26 am
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:

Code
#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 :)
Title: Re: Statement not recognized (or not correctly)
Post by: ollydbg on April 19, 2011, 04:54:20 am
This error is Not related to C::B.
So, I think the best place to ask is: MSVC mail list/newsgroups. or other programming forum.

If you think it is C::B related, you should at least show the full build log message and other infos.