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

Author Topic: sf::Text error VC2005  (Read 2833 times)

0 Members and 1 Guest are viewing this topic.

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
sf::Text error VC2005
« on: June 02, 2011, 04:10:02 pm »
Hi

Just starting to use the font stuff, and with this code running under a Debug version in VC2005

Code: [Select]

        sf::Font myFont;
if (myFont.LoadFromFile("arial.ttf"))
{
sf::Text startText("HELLO",myFont,50);
startText.SetColor(sf::Color(255,255,255));
window1.Draw(startText);
}


I get "Windows has triggered a breakpoint in myapp.exe. This may be due to a corruption of the heap, or any of the DLLs it has loaded".

It breaks in "new.cpp", at the line "while ((p = malloc(size)) == 0)"

Code: [Select]

void *__CRTDECL operator new(size_t size) _THROW1(_STD bad_alloc)
        {       // try to allocate size bytes
        void *p;
        while ((p = malloc(size)) == 0)
                if (_callnewh(size) == 0)
                {       // report no memory
                static const std::bad_alloc nomem;
                _RAISE(nomem);
                }

        return (p);
        }


Call stack:
Code: [Select]

  ntdll.dll!77ac0844()
  [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
  ntdll.dll!77a82a74()
  ntdll.dll!77a3cd87()
  sfml-system-d-2.dll!operator new(unsigned int size=41156608)  Line 59 + 0x9 bytes C++
  KernelBase.dll!751b468e()
  sfml-graphics-d-2.dll!_CrtIsValidHeapPointer(const void * pUserData=0x00767790)  Line 2072 C++
  sfml-graphics-d-2.dll!_free_dbg_nolock(void * pUserData=0x00767790, int nBlockUse=1)  Line 1279 + 0x9 bytes C++
  sfml-graphics-d-2.dll!_free_dbg(void * pUserData=0x00767790, int nBlockUse=1)  Line 1220 + 0xd bytes C++
  sfml-graphics-d-2.dll!operator delete(void * pUserData=0x00767790)  Line 54 + 0x10 bytes C++
  sfml-graphics-d-2.dll!std::allocator<unsigned int>::deallocate(unsigned int * _Ptr=0x00767790, unsigned int __formal=12)  Line 141 + 0x9 bytes C++
  sfml-graphics-d-2.dll!std::basic_string<unsigned int,std::char_traits<unsigned int>,std::allocator<unsigned int> >::_Tidy(bool _Built=true, unsigned int _Newsize=0)  Line 2076 C++
  sfml-graphics-d-2.dll!std::basic_string<unsigned int,std::char_traits<unsigned int>,std::allocator<unsigned int> >::~basic_string<unsigned int,std::char_traits<unsigned int>,std::allocator<unsigned int> >()  Line 906 C++
> sfml-graphics-d-2.dll!sf::String::~String()  + 0x16 bytes C++
  myapp.exe!GfxEngine::init()  Line 140 + 0x7d bytes C++


Ideas?[/code]
SFML 2.1

Bones

  • Newbie
  • *
  • Posts: 24
    • View Profile
sf::Text error VC2005
« Reply #1 on: June 03, 2011, 06:33:06 am »
I'm having the same problem in VC++ 2010!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
sf::Text error VC2005
« Reply #2 on: June 03, 2011, 08:38:50 am »
Does this solve your problem?
https://github.com/SFML/SFML/issues/53
Laurent Gomila - SFML developer

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
sf::Text error VC2005
« Reply #3 on: June 03, 2011, 12:08:17 pm »
Hmm my SFML version is very recent (like 4 days ago ish), and I got the snapshot, no patches have been added to it.

I will try with a static version - do I need to define SFML_STATIC in my pre-processor options? SFML 1.6 had an option to generate the sfml-xx-s dlls, I think....

Thanks
SFML 2.1

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
sf::Text error VC2005
« Reply #4 on: June 03, 2011, 12:13:28 pm »
Quote
Hmm my SFML version is very recent (like 4 days ago ish), and I got the snapshot, no patches have been added to it.

Have you read the issue? Nothing was fixed in the code, you just need to turn off the STATIC_STD_LIBS CMake option.
Laurent Gomila - SFML developer

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
sf::Text error VC2005
« Reply #5 on: June 03, 2011, 12:28:44 pm »
Ah sorry, I did read it but I clearly missed that bit :D
SFML 2.1