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

Author Topic: Buffer overflow when Text.setFont  (Read 1339 times)

0 Members and 1 Guest are viewing this topic.

TurbaVladimir

  • Newbie
  • *
  • Posts: 5
    • View Profile
Buffer overflow when Text.setFont
« on: March 14, 2014, 04:39:39 am »
hi all, i'm have problem. my code work in vs10, but in vs13 debugger say buffer ofverflow when font set to text.i'm compile sfml libs using cmake for vs12 and build project in vs13.i'm not sure but, maybe also need to compile libs for sfml in vc13?

sorry for bad english  :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Buffer overflow when Text.setFont
« Reply #1 on: March 14, 2014, 07:27:17 am »
Yes, you need to compile SFML for VS 2013.
Laurent Gomila - SFML developer

TurbaVladimir

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Buffer overflow when Text.setFont
« Reply #2 on: March 14, 2014, 10:57:24 am »
I did that, but I'm use extlibs like glew and others from sfml 2.1 vs10 package.extlibs need to be builded in vs13?if not why can I have this error?
« Last Edit: March 14, 2014, 11:06:29 am by TurbaVladimir »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Buffer overflow when Text.setFont
« Reply #3 on: March 14, 2014, 11:21:24 am »
No they don't, they are C libraries and are thus compatible with all versions of the compiler.

Are you sure that you're not mixing debug and release mode?
Laurent Gomila - SFML developer

TurbaVladimir

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Buffer overflow when Text.setFont
« Reply #4 on: March 14, 2014, 11:48:45 am »
in archive on this link http://yadi.sk/d/Lw2eYpNXKWeGV some screens of my building sfml and how i get error and log of sfml building. if i'm don't use TextDraw function all works good and game starts.

some words in logs and my system are russians. i can translate that if you need.

yadi.sk is russian file transfer service like dropbox :)
« Last Edit: March 14, 2014, 11:52:21 am by TurbaVladimir »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Buffer overflow when Text.setFont
« Reply #5 on: March 14, 2014, 11:58:57 am »
Everything looks ok.

You should compile and test in debug mode to get more information about the crash. You should also try a minimal example (a simple main() with a font and a text).
Laurent Gomila - SFML developer

TurbaVladimir

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Buffer overflow when Text.setFont
« Reply #6 on: March 14, 2014, 04:06:17 pm »
i build libs for debug mode and write that
#include <SFML/Graphics.hpp>

int main()
{
        sf::Font Font;
        sf::Text Text;
        Font.loadFromFile("munro.ttf");
    sf::RenderWindow window(sf::VideoMode(300, 300), "SFML TEST");
        Text.setString("TEST");
        Text.setFont(Font);
        Text.setCharacterSize(64);
        Text.setColor(sf::Color::White);
        Text.setPosition(150, 150);
        window.draw(Text);
        window.display();
        std::getchar();
    return 0;
}
in debug mode(libs like sfml-window-d.lib) all works but in release(libs like sfml-window.lib) i have error when setFont.

TurbaVladimir

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Buffer overflow when Text.setFont
« Reply #7 on: March 14, 2014, 05:27:48 pm »
i tired and just change compiler to vs10.
solution finded ;D