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

Author Topic: SFML-Network and Visual Studio 2010 (Win 7 x64)  (Read 3845 times)

0 Members and 1 Guest are viewing this topic.

bananu7

  • Newbie
  • *
  • Posts: 25
    • View Profile
SFML-Network and Visual Studio 2010 (Win 7 x64)
« on: October 05, 2010, 05:24:21 pm »
Hi!
I've been trying to integrate SFML with my code. It worked perfectly, but only in Debug mode. When I switched to release (and played with libs for a while) it compiled successfully, but the program breaks at SocketTCP::Connect. My guess is that there's something wrong with Release SFML code. I've compiled the libs and dlls again from provided .sln, but it did't change a thing. Maybe someone has already encountered this error?
Bajtek.

bananu7

  • Newbie
  • *
  • Posts: 25
    • View Profile
SFML-Network and Visual Studio 2010 (Win 7 x64)
« Reply #1 on: October 19, 2010, 12:46:32 pm »
Well... nobody even bother to reply. A bit sad if you ask me. Here's the code, it breaks on m_Socket->Connect(). (Or maybe m_Socket->IsValid, I'm not sure, but debugger shows that little green arrow on Connect())

Code: [Select]

m_Socket = new sf::SocketTCP();
m_Socket->SetBlocking(true);
if (m_Socket->IsValid())
{
sf::Socket::Status SockStat = m_Socket->Connect(port, ip, 10.0f);
if (SockStat != sf::Socket::Done)
{
//...

bananu7

  • Newbie
  • *
  • Posts: 25
    • View Profile
SFML-Network and Visual Studio 2010 (Win 7 x64)
« Reply #2 on: October 19, 2010, 12:51:10 pm »
I've recently checked, and the program works (hence still doesn't connect) when I comment the line with SetBlocking(true)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML-Network and Visual Studio 2010 (Win 7 x64)
« Reply #3 on: October 20, 2010, 08:43:49 am »
Can you provide a complete and minimal code that reproduces this problem?
Laurent Gomila - SFML developer

bananu7

  • Newbie
  • *
  • Posts: 25
    • View Profile
SFML-Network and Visual Studio 2010 (Win 7 x64)
« Reply #4 on: October 24, 2010, 09:55:39 pm »
Well, actually it's a real puzzle to compile it. There's no way to compile a project with SFML linked statically in VS2010

bananu7

  • Newbie
  • *
  • Posts: 25
    • View Profile
SFML-Network and Visual Studio 2010 (Win 7 x64)
« Reply #5 on: October 24, 2010, 10:04:36 pm »
I've tried with the sample code. Debug works like a charm, while release... client crashes. So it's certainly NOT my code.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML-Network and Visual Studio 2010 (Win 7 x64)
« Reply #6 on: October 24, 2010, 10:48:17 pm »
Are you sure that you link to a release build in release mode?
Laurent Gomila - SFML developer

bananu7

  • Newbie
  • *
  • Posts: 25
    • View Profile
SFML-Network and Visual Studio 2010 (Win 7 x64)
« Reply #7 on: October 24, 2010, 10:58:02 pm »
I link to sfml-network.lib.
I've been trying to load symbols for this dll, but there were more problems. However, I've managed to get the exact breaking point - sf::IpAddress constructor -> which uses winsock's gethostbyname.

bananu7

  • Newbie
  • *
  • Posts: 25
    • View Profile
SFML-Network and Visual Studio 2010 (Win 7 x64)
« Reply #8 on: October 24, 2010, 11:24:21 pm »
Wooah!
It works. I've recompiled whole SFML again. I think it's a real problem there aren't any .sln for VS2010...

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
SFML-Network and Visual Studio 2010 (Win 7 x64)
« Reply #9 on: October 25, 2010, 12:42:47 am »
Quote from: "bananu7"
I think it's a real problem there aren't any .sln for VS2010...
I don't think so, as you can convert the VS 2008 ones.

Anyway: In the future, Laurent plans to use CMake which can directly build VS 2010 projects.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: