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

Author Topic: Having trouble loading an image  (Read 2370 times)

0 Members and 1 Guest are viewing this topic.

Treena

  • Newbie
  • *
  • Posts: 7
    • View Profile
Having trouble loading an image
« on: September 26, 2010, 03:11:00 am »
I'm getting strange errors in Visual Studio 2010 when running the "Display a Sprite" tutorial. I'm able to run the "Using rendering windows" sample program, but the title of the window it produces isn't "SFML Graphics". It has some strange characters before SFML.

But when I try to run the "Display a Sprite" tutorial, the program starts beeping and then it stops responding. The console window also displays a lot of weird characters.

Since I can run the "Using rendering windows" sample program, I don't think this error has to do with installing SFML, but correct me if I'm wrong.

And the sprite I'm trying to load is a triangle I drew in paint and saved it as a .png.

Can anyone help me?

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Having trouble loading an image
« Reply #1 on: September 26, 2010, 03:20:37 am »
Have you linked the correct libraries?

sfml-module.lib in dynamic release mode
sfml-module-d.lib in dynamic debug mode
sfml-module-s.lib in static release mode
sfml-module-s-d.lib in static debug mode

...where module is the package (system, window, graphics...) you are using. In SFML 2, the libraries start with sfml2 instead of sfml.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Treena

  • Newbie
  • *
  • Posts: 7
    • View Profile
Having trouble loading an image
« Reply #2 on: September 26, 2010, 04:36:50 am »
Quote from: "Nexus"
Have you linked the correct libraries?

sfml-module.lib in dynamic release mode
sfml-module-d.lib in dynamic debug mode
sfml-module-s.lib in static release mode
sfml-module-s-d.lib in static debug mode

...where module is the package (system, window, graphics...) you are using. In SFML 2, the libraries start with sfml2 instead of sfml.


Thanks for the reply!
How would I know if I'm in dynamic release mode, dynamic debug mode, static release mode or static debug mode?

Um I've linked sfml-graphics.lib in my projects properties -> config properties -> Linker -> Input -> Additional Dependencies

Also, I'm using SFML 1.6. Would you recommend using SFML 2.0?

PeterWelzien

  • Newbie
  • *
  • Posts: 38
    • View Profile
Having trouble loading an image
« Reply #3 on: September 26, 2010, 11:06:49 am »
In the toolbar of VS2010 there's combo box where you can switch between Debug and Release. In the top left of the properties windows you can select if you want to set the properties for Debug or Release (or All configurations).

I suggest that you add all SFML libraries to your projects. Then you don't have to risk missing one.
/Peter Welzien

Treena

  • Newbie
  • *
  • Posts: 7
    • View Profile
Having trouble loading an image
« Reply #4 on: September 26, 2010, 06:39:33 pm »
Thanks to you guys, I found that I was in debug mode, so in the project properties, I linked sfml-graphics-d.lib instead of sfml-graphics.lib, and it worked!!!  :D

 

anything