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

Author Topic: nonCopyable class error  (Read 2029 times)

0 Members and 1 Guest are viewing this topic.

hammad khan

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
nonCopyable class error
« on: September 16, 2013, 09:37:59 am »
and when i do this i got this i get the following error.

sf::Thread thread( &sf::TcpSocket::receive, socket);
thread.launch();

error on the first argument is the unknown type error.

and when i do this

void send( sf::TcpSocket socket )

and create a thread like this

sf::Thread thread( &send, socket);
thread.launch();
 get the following error

Error   1   error C2248: 'sf::NonCopyable::NonCopyable' : cannot access private member declared in class 'sf::NonCopyable'   c:\users\destraction\desktop\laurentgomila-sfml-ef78b6d\include\sfml\network\socket.hpp   178   1   sfml 3.0

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: nonCopyable class error
« Reply #1 on: September 16, 2013, 09:48:52 am »
Socket classes are not copyable, you must pass a reference or a pointer to your socket to the thread constructor.
Laurent Gomila - SFML developer

 

anything