SFML community forums
Help => Graphics => Topic started by: FrewCen on February 29, 2012, 08:42:32 am
-
Hi.
I have successfuly compiled SFML for VC2010 and window is running.
Unfortunately , I have new problem.
#include <SFML\System.hpp>
#include <SFML\Graphics.hpp>
#include <SFML\Window.hpp>
#include <iostream>
int main(int argc, char **argv[])
{
sf::RenderWindow WND(sf::VideoMode(800, 600, 32), "LOLOLOLOLOLOLOL");
sf::Image img;
img.LoadFromFile("test.jpg");
sf::Sprite sprite;
sprite.SetImage(img);
sprite.SetPosition(20.0f, 20.0f);
while(WND.IsOpened())
{
sf::Event Event;
while(WND.GetEvent(Event))
{
switch(Event.Type)
{
case sf::Event::Closed:
WND.Close();
break;
case sf::Event::MouseLeft:
WND.Close();
break;
default:
break;
}
}
WND.Clear();
WND.Draw(sprite);
WND.Display();
}
return 0;
}
This is my code. My error is not writeable. When the program arrive on the code sf::Image img;
img.LoadFromFile("test.jpg");
, it starts to beep... BEEP BEEP BEEP. And in console I have this output:
(http://img714.imageshack.us/img714/3306/9de670a005ff41b3b8b396e.png)
Than, I'm getting this from visual studio:
(http://img717.imageshack.us/img717/233/6990449424c14212b39d6ce.png) (On starting is: Failed to load image nad some characters)
So whats should I do? Please help.
P.S.: I've tried to place text "Crazy beeping sfml" to google and it not helped.[/quote]
-
Make sure that you're not linking to release SFML libraries in debug mode.
-
Do you mean: /MTd and /MDd or ?
If you mean releases and versions, I have 1.6 (which was compiled by me).
(and if you mean the build functions in visual studio where are: debug, debug dll, debug static, release, release dll, release static...... do you?)
-
There are two variants of the SFML libraries: debug and release.
There are two variants of your program: debug and release.
I mean: don't mix them ;)
-
Thanks, works!!!
(Sorry for idiot questions, but before I started c++ i worked in C#... since than everything changes and now I have little problem to use c++...)