Visual studio 2010 with sfml 2.0 problem with Window Title

Started by
3 comments, last by BaneTrapper 11 years, 6 months ago
Hello.
I just downloaded visual studio 2010, so i am kind of new to it.
There is a test program to check if its just working.
But the title of the window is all wrong, and each run gives different resault,
i got these results from 3 runs of the program ("En", "E{", "E3") as the name of the window

Any ideas what i did wrong, cause i redone all linking and stuff, still getting error/title name being wrong.

EDIT:: i did download SFML 2.0 for visual studio 2010


#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(shape);
window.display();
}
return 0;
}
Advertisement
The Source code looks fine and it shouldn´t be a character encoding issue (Is Unicode implemented in SFML?)

Do you see the Circle?
Any compiler warnings?

Did you try sf::Window::SetTitle() ?
I' once had the exact same problem. The chance is that you are linking against release library when you are actually debugging.

Visit below link

http://en.sfml-dev.o...g60228#msg60228
An invisible text.

The Source code looks fine and it shouldn´t be a character encoding issue (Is Unicode implemented in SFML?)




Did you try sf::Window::SetTitle() ?
[/quote]
I just got another incorrect name


Do you see the Circle?
[/quote]
Yes, even when i rescale and stuff, the displayed is correct.


Any compiler warnings?
[/quote]
I don't think there is error anywhere

1>------ Build started: Project: Adventure, Configuration: Debug Win32 ------
1> main.cpp
1> Adventure.vcxproj -> C:\C++ Visual projects\Adventure\Debug\Adventure.exe
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========


This is the output after program was closed, its called "Adventure" aniway

The thread 'Win32 Thread' (0x870) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xb2c) has exited with code 0 (0x0).
The program '[1904] Adventure.exe: Native' has exited with code 0 (0x0).

I' once had the exact same problem. The chance is that you are linking against release library when you are actually debugging.

Visit below link

http://en.sfml-dev.o...g60228#msg60228

I believe this would do it, but am going to work atm, Thx for help.

EDIT:: SFML WORKS!
Name is fixed, my error was:
while at Project properties, Linker, Input, Aditional dependecies, i did it like this

sfml-window.lib

while debug needs to be

sfml-window-d.lib


Thanks for the help!

This topic is closed to new replies.

Advertisement