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

Author Topic: Unhandled exception  (Read 1631 times)

0 Members and 1 Guest are viewing this topic.

rufee

  • Newbie
  • *
  • Posts: 1
    • View Profile
Unhandled exception
« on: November 09, 2012, 04:55:45 pm »
Hello,
Ive been tempted to play around with networking for quite a while, then I found sfml so I thought why not try it out :)
Anyway getting to the point, I want to write a simple program to send a UDP packet to a specified ip address and await a response from the server on the other end.
#include <iostream>
#include <SFML\System.hpp>
#include <SFML\Network.hpp>

using namespace std;
using namespace sf;

int main(void)
{
        string ip;
        IPAddress address = IPAddress::GetLocalAddress();
        ip = address.ToString();
        cout << "Network address: " << ip << endl;

        string a;
        while(a != "exit")
        {
                cin >> a;
        }

        return 0;
}
 

As you can see I want to print out my local ip address, but when I compile I get an error:
Unhandled exception at 0x6da62520 in client.exe: 0xC0000005: Access violation reading location 0x00cefe88.
I am using VS2010 and the sfml is set to be linked dynamically, using the release version of the libs and build target is set to release. I believe this is some incompatibility issue between libraries built on VS2008 and used with 2010, tried to compile the library on my own but been getting errors there.

Any input is appreciated :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Unhandled exception
« Reply #1 on: November 09, 2012, 05:03:14 pm »
Quote
I believe this is some incompatibility issue between libraries built on VS2008 and used with 2010
Right.

Quote
tried to compile the library on my own but been getting errors there
Which ones?
There are tons of messages about that on the forum, you should find answers easily.
Laurent Gomila - SFML developer