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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - rufee

Pages: [1]
1
Network / 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 :)

Pages: [1]