SFML community forums
Help => Network => Topic started 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:
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?
-
Which compiler ? Which OS ? Which version of SFML ?
-
VS 2005, Windows XP, SFML 1.2
-
Are you linking with sfml-network.lib (or sfml-network-d.lib in debug) ?
-
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.
-
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
-
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
-
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.