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

Author Topic: [Simple chat] Problems with client integration!  (Read 3534 times)

0 Members and 1 Guest are viewing this topic.

Zeneus

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • Email
[Simple chat] Problems with client integration!
« on: March 28, 2013, 06:34:58 pm »
Hello guys! Long time no see..!!
I've been working on a new project with some class-mates of mine, and we need to chat with each-other..
This is my half-part of the project, and i've done the server part at the very base..
Now i tried to make the client side, which gave me this error:
Quote
1>Client.obj : error LNK2001: unresolved external symbol "public: static class sf::Time const sf::Time::Zero" (?Zero@Time@sf@@2V12@B)
With a following of LNK1120:unresolved externals..
Anything i can do to make it working?
code:
#include <iostream>                             //For basic terminal-like behaviour and features
#include <string>                               //String recognition through the terminal
#include <SFML/Network.hpp>             //SFML Network library for networking

int main() {
        //Collect needed information
                //Server IP-Address
                std::string serverCurIP;
                std::cout << "Server IP: ";
                        std::cin >> serverCurIP;
                        sf::IpAddress serverIP = serverCurIP;
                //Server Port
                unsigned short serverCurPort;
                std::cout << "Server Port: ";
                        std::cin >> serverCurPort;

        // Create the new TCP-socket using the given data
                        sf::TcpSocket clientSock;
                        clientSock.connect(serverIP, serverCurPort);
                        std::string test = "testing data";
                        clientSock.send(test.c_str(), test.length() +1);
}

Thanks in advance!
« Last Edit: March 29, 2013, 07:22:19 pm by Laurent »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: [Simple chat] Problems with client integration!
« Reply #1 on: March 28, 2013, 06:42:48 pm »
Don't forget to link sfml-system.
Laurent Gomila - SFML developer

Zeneus

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • Email
Re: [Simple chat] Problems with client integration!
« Reply #2 on: March 28, 2013, 06:50:24 pm »
Already done, both debug and release.. (Im working on VC2010 btw)..

I checked the old thread with this error, so i fixed and nothing hapenned..

Zeneus

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • Email
Re: [Simple chat] Problems with client integration!
« Reply #3 on: March 29, 2013, 07:19:32 pm »
bump?  :-\

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: [Simple chat] Problems with client integration!
« Reply #4 on: March 29, 2013, 07:22:04 pm »
You should upload your project file (.vcxproj).
Laurent Gomila - SFML developer

Zeneus

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • Email
Re: [Simple chat] Problems with client integration!
« Reply #5 on: March 29, 2013, 07:31:18 pm »
Here you go:
i hope you needed only the .sln file.. haven't been in this procedure before..   :) :)

EDIT:: Sorry.. sleeping brain.. uploaded the .vcxproj file :)
http://www.mediafire.com/download.php?ka3nuu0r3m14v0p
~Zeneus
« Last Edit: March 29, 2013, 07:37:18 pm by Zeneus »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: [Simple chat] Problems with client integration!
« Reply #6 on: March 29, 2013, 07:54:56 pm »
You define SFML_STATIC but don't link to static libraries (those have the -s suffix).
Laurent Gomila - SFML developer

Zeneus

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • Email
Re: [Simple chat] Problems with client integration!
« Reply #7 on: March 29, 2013, 08:02:55 pm »
so should i remove the SFML_STATIC?
EDIT::: Ok removed SFML_STATIC and everything's back to normal now :) thanks Laurent!
Lock request!
~Zeneus
« Last Edit: March 29, 2013, 08:06:23 pm by Zeneus »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: [Simple chat] Problems with client integration!
« Reply #8 on: March 29, 2013, 08:06:41 pm »
Yes. Or link to the static libraries, if you keep it.
Laurent Gomila - SFML developer

 

anything