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

Author Topic: Strange characters in Title bar  (Read 9913 times)

0 Members and 1 Guest are viewing this topic.

Pfhreak

  • Newbie
  • *
  • Posts: 11
    • View Profile
Strange characters in Title bar
« on: September 16, 2007, 01:20:17 am »
I'm using the code from the graphics tutorial. I keep getting these strange characters in my title bar.

ÌÌÌÌSFML Test


This is a win32 application (not console.) I've linked sfml-graphics.lib, sfml-main.lib, sfml-window.lib, and sfml-system.lib in that order.

Code: [Select]

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics.hpp>

////////////////////////////////////////////////////////////
/// Entry point of application
///
/// \return Application exit code
///
////////////////////////////////////////////////////////////
int main()
{

    // Create the main rendering window
sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Test",sf::Window::Fixed);

    // Change background color to red
    App.SetBackgroundColor(sf::Color(0, 0, 0));

    // Start game loop
    bool Running = true;
    while (Running)
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Close)
                Running = false;

            // A key has been pressed
            if (Event.Type == sf::Event::KeyPressed)
            {
                // Escape key : exit
                if (Event.Key.Code == sf::Key::Escape)
                    Running = false;

                // F1 key : capture a screenshot
                if (Event.Key.Code == sf::Key::F1)
{
sf::Image Screen = App.Capture();
Screen.SaveToFile("screenshot.jpg");
}
            }
        }

        // Display window contents on screen
        App.Display();
    }

    return EXIT_SUCCESS;
}

jbadams

  • Newbie
  • *
  • Posts: 12
    • View Profile
Strange characters in Title bar
« Reply #1 on: September 16, 2007, 09:53:28 am »
Sounds like exactly the same problem as in this thread.

Have you linked with the correct version of the libraries, and if you're currently compiling in debug mode are you using the debug versions (which end with "-d")?  When asking for help it can also be useful to let us know which programming environment and compiler you're using.

Hope that helps.  :)

Pfhreak

  • Newbie
  • *
  • Posts: 11
    • View Profile
Strange characters in Title bar
« Reply #2 on: September 16, 2007, 07:47:55 pm »
Sorry, I'm using Visual Studio 2005.

I'm compiling in debug mode, but with the regular libraries.

If I change the libraries to their -d equivalents I get over 200 linker errors.
My only thought is that I somehow installed it wrong?

Here's what I did:
Copied the items in the vc2005/lib/static folder to my VC/lib folder.
Copied the SFML folder to my VC/Include folder.

Then I added the pieces I wanted to my linker:
sfml-graphics.lib sfml-main.lib sfml-windows.lib sfml-system.lib

Then I had to exlude the following from my linker:
msvcrtd.lib

That is ALL I did, are there any other steps? Am I missing something here?

EDIT:
If I try and build a release version using the libraries, I get this error:
Code: [Select]

fatal error C1047: The object or library file 'G:\Development\Microsoft Visual Studio 8\VC\lib\sfml-graphics.lib' was created with an older compiler than other objects; rebuild old objects and libraries

Mindiell

  • Hero Member
  • *****
  • Posts: 1261
    • ICQ Messenger - 41484135
    • View Profile
Strange characters in Title bar
« Reply #3 on: September 16, 2007, 08:08:15 pm »
If you are compiling in debug mode, you have t ouse the -d libraries.
When you link the libraries you have to do it in the good order :
-lsfml-graphics-d
-lsfml-window-d
-lsfml-system-d
Mindiell
----

Pfhreak

  • Newbie
  • *
  • Posts: 11
    • View Profile
Strange characters in Title bar
« Reply #4 on: September 16, 2007, 08:25:08 pm »
Quote from: "Mindiell"
If you are compiling in debug mode, you have t ouse the -d libraries.
When you link the libraries you have to do it in the good order :
-lsfml-graphics-d
-lsfml-window-d
-lsfml-system-d


Yes, this is true. This works fine if I am trying to do a console application. Although it does generate 19 linker warnings.

I don't want that console window to pop up, so I made a win32 application. The tutorials say that I can include sfml-main.lib and just use int main() as an application starting point. Is there a better way to accomplish this?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Strange characters in Title bar
« Reply #5 on: September 17, 2007, 09:06:24 am »
Quote
If I change the libraries to their -d equivalents I get over 200 linker errors.

Which errors ?

Quote
Yes, this is true. This works fine if I am trying to do a console application. Although it does generate 19 linker warnings.

Which warnings ?
Laurent Gomila - SFML developer

FallingSky

  • Newbie
  • *
  • Posts: 5
    • View Profile
Strange characters in Title bar
« Reply #6 on: October 11, 2007, 05:35:01 pm »
Quote from: "Pfhreak"
Sorry, I'm using Visual Studio 2005.

I'm compiling in debug mode, but with the regular libraries.

If I change the libraries to their -d equivalents I get over 200 linker errors.
My only thought is that I somehow installed it wrong?

Here's what I did:
Copied the items in the vc2005/lib/static folder to my VC/lib folder.
Copied the SFML folder to my VC/Include folder.

Then I added the pieces I wanted to my linker:
sfml-graphics.lib sfml-main.lib sfml-windows.lib sfml-system.lib

Then I had to exlude the following from my linker:
msvcrtd.lib

That is ALL I did, are there any other steps? Am I missing something here?

EDIT:
If I try and build a release version using the libraries, I get this error:
Code: [Select]

fatal error C1047: The object or library file 'G:\Development\Microsoft Visual Studio 8\VC\lib\sfml-graphics.lib' was created with an older compiler than other objects; rebuild old objects and libraries


I had the same problem many times, try doing a full rebuild... Build->Rebuild

 

anything