Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [Solved] Socket operator error in 2.0 master  (Read 2168 times)

0 Members and 1 Guest are viewing this topic.

thynnmas

  • Newbie
  • *
  • Posts: 2
    • View Profile
[Solved] Socket operator error in 2.0 master
« on: May 02, 2012, 02:25:08 pm »
First post here, so hi!

I'm currently working with the master branch from git, and when attempting to use the networking layer I get these errors:

2>c:\users\thynnmas\documents\visual studio 2010\sfml\2.0 c++\include\sfml\network\socket.hpp(178): error C2248: 'sf::NonCopyable::operator =' : cannot access private member declared in class 'sf::NonCopyable'
2>          c:\users\thynnmas\documents\visual studio 2010\sfml\2.0 c++\include\sfml\system\noncopyable.hpp(79) : see declaration of 'sf::NonCopyable::operator ='
2>          c:\users\thynnmas\documents\visual studio 2010\sfml\2.0 c++\include\sfml\system\noncopyable.hpp(42) : see declaration of 'sf::NonCopyable'
2>          This diagnostic occurred in the compiler generated function 'sf::Socket &sf::Socket::operator =(const sf::Socket &)'

This happens with the tutorial code (adapted for 2.0), the example from github and my own code. Any ideas as to what is causing this?
« Last Edit: May 02, 2012, 02:43:26 pm by thynnmas »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Socket operator error in 2.0 master
« Reply #1 on: May 02, 2012, 02:31:01 pm »
Sockets classes are no longer copyable in SFML 2, you must handle them as entities, not as values.
Laurent Gomila - SFML developer

thynnmas

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Socket operator error in 2.0 master
« Reply #2 on: May 02, 2012, 02:43:08 pm »
Yeah, I got that part, which was why I was so confused. Turns out my listener was declared somewhere else (with a copy), and that was what caused it. Thanks.

 

anything