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

Author Topic: Exception on sf::IpAddress.toString();  (Read 1381 times)

0 Members and 1 Guest are viewing this topic.

funkyjive

  • Newbie
  • *
  • Posts: 2
    • View Profile
Exception on sf::IpAddress.toString();
« on: August 12, 2016, 08:53:26 am »
Using the newest version of SFML. Easy to reproduce:

sf::IpAddress public_address;
public_address = sf::IpAddress::getLocalAddress();
public_address.toString();
//public_address.toInteger();

Exception on the .toString() function. The interesting bit is that if I comment it out and try .toInteger() the value seems to be correct (IP address I expect).

In the infinite wisdom of windows I cannot copy and paste the exception message so attached is a screenshot.

The only thing I can think of is that it is something to do with character set. In visual studio I have the character set configured for "not set" to eliminate some errors from wide to char conversions elsewhere.

Thanks in advance!

funkyjive

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Exception on sf::IpAddress.toString();
« Reply #1 on: August 12, 2016, 09:24:05 am »
Solved it but don't know why. For the next poor sucker who's stuck up late at night 4 pages deep on google looking for a solution, it's a mismatch between static sfml libraries and dynamic runtime library. I changed my linker settings for by debug build to be  sfml-network-d.lib instead of sfml-network.lib and it seems to be working fine now.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Exception on sf::IpAddress.toString();
« Reply #2 on: August 12, 2016, 09:50:27 am »
Quote
Solved it but don't know why. For the next poor sucker who's stuck up late at night 4 pages deep on google looking for a solution [...]
... just read the "getting started" tutorial carefully ;)
Laurent Gomila - SFML developer

 

anything