SFML community forums

Help => Network => Topic started by: vidjogamer on April 17, 2011, 03:45:57 am

Title: [SFML2] sf::Socket::Status::Done warning/error
Post by: vidjogamer on April 17, 2011, 03:45:57 am
Code: [Select]
if(socket.Receive(packet,address,port) == sf::Socket::Status::Done)


gives me this warning in visual c++ 2010:

Quote
warning C4482: nonstandard extension used: enum 'sf::Socket::Status' used in qualified name


In linux it actually gives me an error. I would post the error but I dont have access to a linux machine at the moment.
Title: [SFML2] sf::Socket::Status::Done warning/error
Post by: JAssange on April 17, 2011, 08:32:15 am
When I get an error like this I usually included too much on the enum. I believe you want to just use Status::Done or if you haven't using'd sf then sf::Status::Done.
Title: [SFML2] sf::Socket::Status::Done warning/error
Post by: Laurent on April 17, 2011, 10:01:52 am
In C++ (until the next standard is released), the name of an enum is not part of the qualification. So it's not sf::Socket::Status::Done but sf::Socket::Done.

You should simply have read the doc and tutorials ;)
Title: [SFML2] sf::Socket::Status::Done warning/error
Post by: vidjogamer on April 17, 2011, 08:17:03 pm
Oh! Dumb mistake. Funny thing is that I did look at the tutorials. I just completely overlooked the difference. Thats what I get for staying up too late coding XD