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

Author Topic: Network linking error  (Read 15389 times)

0 Members and 1 Guest are viewing this topic.

Pwndja

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Network linking error
« on: February 15, 2008, 06:53:43 am »
Here is the error I get when I try to use the GetSocketsReady() for a SelectorTCP

error LNK2019: unresolved external symbol ___WSAFDIsSet@8 referenced in function "public: bool __thiscall sf::Selector<class sf::SocketTCP>::GetSocketsReady(class std::vector<class sf::SocketTCP,class std::allocator<class sf::SocketTCP> > &,float)" (?GetSocketsReady@?$Selector@VSocketTCP@sf@@@sf@@QAE_NAAV?$vector@VSocketTCP@sf@@V?$allocator@VSocketTCP@sf@@@std@@@std@@M@Z)

here is the code where it is messing up at:

Code: [Select]
std::vector<sf::SocketTCP> readySockets;
while(1)
{

server.GetSocketsReady( readySockets ); //This line here is what is causing the error.

for (std::vector<sf::SocketTCP>::iterator i = readySockets.begin(); i != readySockets.end(); ++i)
{
}
}


any ideas on how to solve this problem?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Network linking error
« Reply #1 on: February 15, 2008, 08:40:48 am »
Which compiler ? Which OS ? Which version of SFML ?
Laurent Gomila - SFML developer

Pwndja

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
stats
« Reply #2 on: February 15, 2008, 09:24:11 am »
VS 2005, Windows XP, SFML 1.2

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Network linking error
« Reply #3 on: February 15, 2008, 12:14:38 pm »
Are you linking with sfml-network.lib (or sfml-network-d.lib in debug) ?
Laurent Gomila - SFML developer

Pwndja

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
linking with
« Reply #4 on: February 15, 2008, 11:26:56 pm »
These are the libs I am linking with:

sfml-network-d.lib sfml-window-d.lib sfml-system-d.lib

so the debug one

I just tried the sfml-network.lib the none debug one and still get the same error, there is no difference.

Pwndja

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
works with static libs
« Reply #5 on: February 16, 2008, 01:12:05 am »
So i changed the libs from dynamic to static and the code works... So you might want to see if the dynamic libs are working correctly or not... Let me know when you get them working because I would like to be able to use them instead of the static later on.

Thank you

Pwndja

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
missing a linker include
« Reply #6 on: February 16, 2008, 01:25:55 am »
So figured out how to get the code to work with the dynamic libs.... you need to include in the linker input added dependancies this line

Ws2_32.lib

and it links correctly

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Network linking error
« Reply #7 on: February 16, 2008, 04:40:48 am »
You shouldn't have to link to ws2_32.lib, as it's already done in sfml-network. I've never seen this problem before.
Laurent Gomila - SFML developer