SFML community forums

Help => Network => Topic started by: Pwndja on February 15, 2008, 06:53:43 am

Title: Network linking error
Post by: Pwndja 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?
Title: Network linking error
Post by: Laurent on February 15, 2008, 08:40:48 am
Which compiler ? Which OS ? Which version of SFML ?
Title: stats
Post by: Pwndja on February 15, 2008, 09:24:11 am
VS 2005, Windows XP, SFML 1.2
Title: Network linking error
Post by: Laurent on February 15, 2008, 12:14:38 pm
Are you linking with sfml-network.lib (or sfml-network-d.lib in debug) ?
Title: linking with
Post by: Pwndja 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.
Title: works with static libs
Post by: Pwndja 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
Title: missing a linker include
Post by: Pwndja 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
Title: Network linking error
Post by: Laurent 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.