SFML community forums
Help => Network => Topic started by: Nobody on April 27, 2008, 01:30:02 pm
-
Hi
i do not know my mistake, but i cant get my ipaddress.
I ve tried it in many different ways.
For example
sf::IPAddress IP;
IP.GetLocalAddress();
Codeblocks says...
Compiling: main.cpp
Linking executable: Network.exe
.objs\main.o:main.cpp:(.text+0x296): undefined reference to `sf::IPAddress::IPAddress()'
.objs\main.o:main.cpp:(.text+0x29b): undefined reference to `sf::IPAddress::GetLocalAddress()'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
0 errors, 0 warnings
sry english is not my native language
-
Have you linked to sfml-network ?
-
Yes
First I tried it so...
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Network.hpp>
#include <iostream>
#include <windows.h>
sf::RenderWindow Main;
sf::Event Eventmenu;
sf::Image ImMainBackground;
sf::Sprite SpMainBackground;
sf::String StIp;
bool exit2;
int main()
{
Main.Create(sf::VideoMode(300, 500, 32), "test", sf::Style::Close);
//Main.SetBackgroundColor (sf::Color(0,200,100));
exit2=false;
sf::IPAddress IP("nobody");
StIp.SetText(IP.ToString());
if (!ImMainBackground.LoadFromFile("1.jpg"))
return EXIT_FAILURE;
SpMainBackground.SetImage(ImMainBackground);
while(exit2==false)
{
while (Main.GetEvent(Eventmenu))
{
// Close window : exit
if (Eventmenu.Type == sf::Event::Closed)
{
exit2=true;
}
}
//Main.SetFramerateLimit(50);
Main.Draw(SpMainBackground);
Main.Display();
}
return 0;
}
-
What are your linker settings ? Which version of the SFML libraries are you using (static or dynamic) ?
-
i have got version 1.2 (static)
i have done it like it is said in the tutorial and everthings else runs fine (sprite ...)
should i use dynamic?
-
now it runs fine
i have forgotten "-lsfml-network"?
thank you
sfml is an excellent project...good work
I hope in the future there are also control elements like buttons and so on