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

Author Topic: Buffer Overrun on starting a window  (Read 6027 times)

0 Members and 1 Guest are viewing this topic.

kamac

  • Newbie
  • *
  • Posts: 19
    • View Profile
Buffer Overrun on starting a window
« on: January 17, 2012, 12:13:21 pm »
My application compiles properly, but when it starts and initiates the window, i get a error:

Quote
A buffer overrun has occurred in Isometric.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program.

For more details please see Help topic 'How to debug Buffer Overrun Issues'.


Which points to these lines in gs_report.c:

Code: [Select]
#if defined (_CRTBLD) && !defined (_SYSCRT)
    DebuggerWasPresent = IsDebuggerPresent();
    _CRT_DEBUGGER_HOOK(_CRT_DEBUGGER_GSFAILURE); <- This
#endif  /* defined (_CRTBLD) && !defined (_SYSCRT) */


And here's my code:

Code: [Select]
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <iostream>

int main() {

sf::RenderWindow App(sf::VideoMode(800,600,32),"Test");

while(App.IsOpened())
{
sf::Event Event;
while(App.GetEvent(Event))
{
if(Event.Type == sf::Event::Closed) {
App.Close();
}
}

App.Clear();
App.Display();
}


return 0;
}


Here are my linked libraries:

Code: [Select]
sfml-main.lib
sfml-graphics.lib
sfml-window.lib
sfml-system.lib
sfml-network.lib


I have all of them (.dlls) in my release folder and so on.

Here are the logs.
Debug logs:

Quote
'Isometric.exe': Loaded 'C:\Documents and Settings\Ewa\Pulpit\Projekty_C++\Isometric\Release\Isometric.exe', Symbols loaded.
'Isometric.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\Program Files\AVAST Software\Avast\snxhk.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\Documents and Settings\Ewa\Pulpit\Projekty_C++\Isometric\Release\sfml-graphics.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\system32\opengl32.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\system32\secur32.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\system32\user32.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\system32\glu32.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\system32\ddraw.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\system32\dciman32.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\Documents and Settings\Ewa\Pulpit\Projekty_C++\Isometric\Release\sfml-window.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\system32\winmm.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\Documents and Settings\Ewa\Pulpit\Projekty_C++\Isometric\Release\sfml-system.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4974_x-ww_d889290f\msvcp90.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4974_x-ww_d889290f\msvcr90.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\system32\msvcp100.dll', Symbols loaded.
'Isometric.exe': Loaded 'C:\WINDOWS\system32\msvcr100.dll', Symbols loaded.
'Isometric.exe': Loaded 'C:\WINDOWS\system32\msctf.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\system32\atioglxx.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\system32\version.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\system32\ws2_32.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\system32\ws2help.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\system32\atiadlxx.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\system32\setupapi.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.3053_x-ww_b80fa8ca\msvcr80.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\system32\mcd32.dll', Cannot find or open the PDB file
'Isometric.exe': Unloaded 'C:\WINDOWS\system32\mcd32.dll'
'Isometric.exe': Loaded 'C:\WINDOWS\system32\dinput.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\system32\hid.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\system32\wintrust.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\system32\crypt32.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\system32\msasn1.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\system32\imagehlp.dll', Cannot find or open the PDB file
First-chance exception at 0x6f007200 in Isometric.exe: 0xC0000005: Access violation reading location 0x6f007200.
A buffer overrun has occurred in Isometric.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program.

For more details please see Help topic 'How to debug Buffer Overrun Issues'.
The program '[5720] Isometric.exe: Native' has exited with code 0 (0x0).


Build logs:

Quote
1>------ Build started: Project: Isometric, Configuration: Release Win32 ------
1>  main.cpp
1>  Generating code
1>  Finished generating code
1>  Isometric.vcxproj -> C:\Documents and Settings\Ewa\Pulpit\Projekty_C++\Isometric\Release\Isometric.exe
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========


That's it from my output. I don't think i am mixing builds... Aha, also i have SFML_DYNAMIC defined in preprocessor.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Buffer Overrun on starting a window
« Reply #1 on: January 17, 2012, 12:34:00 pm »
Which version of Visual C++ is it? Does it work in Debug mode?
Laurent Gomila - SFML developer

kamac

  • Newbie
  • *
  • Posts: 19
    • View Profile
Buffer Overrun on starting a window
« Reply #2 on: January 17, 2012, 12:47:03 pm »
It's Microsoft Visual C++ 2010.

Debug doesn't work. It crashes at the startup with error that it wasn't initialized correctly (The Isometric.exe). Here are the logs:

Quote
'Isometric.exe': Loaded 'C:\Documents and Settings\Ewa\Pulpit\Projekty_C++\Isometric\Debug\Isometric.exe', Symbols loaded.
'Isometric.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\Program Files\AVAST Software\Avast\snxhk.dll', Cannot find or open the PDB file
'Isometric.exe': Loaded 'C:\Documents and Settings\Ewa\Pulpit\Projekty_C++\Isometric\Isometric\sfml-graphics-d.dll', Cannot find or open the PDB file
LDR: LdrpWalkImportDescriptor() failed to probe C:\Documents and Settings\Ewa\Pulpit\Projekty_C++\Isometric\Isometric\sfml-graphics-d.dll for its manifest, ntstatus 0xc0150002
Debugger:: An unhandled non-continuable exception was thrown during process load
The program '[9760] Isometric.exe: Native' has exited with code -1072365566 (0xc0150002).


And the build logs from debug:


Quote
1>------ Build started: Project: Isometric, Configuration: Debug Win32 ------
1>  main.cpp
1>  Isometric.vcxproj -> C:\Documents and Settings\Ewa\Pulpit\Projekty_C++\Isometric\Debug\Isometric.exe
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========


And i linked these libraries to the debug:

Code: [Select]
sfml-main-d.lib
sfml-graphics-d.lib
sfml-window-d.lib
sfml-system-d.lib
sfml-network-d.lib

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Buffer Overrun on starting a window
« Reply #3 on: January 17, 2012, 01:19:03 pm »
Have you recompiled SFML?
Laurent Gomila - SFML developer

kamac

  • Newbie
  • *
  • Posts: 19
    • View Profile
Buffer Overrun on starting a window
« Reply #4 on: January 17, 2012, 01:25:42 pm »
No, i didn't.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Buffer Overrun on starting a window
« Reply #5 on: January 17, 2012, 01:29:31 pm »
You can't use Visual C++ 2008 libraries with Visual C++ 2010, so you must recompile it.

There are tons of posts about this issue on the forum, even video tutorials and pre-compiled binaries. If you can find them.
Laurent Gomila - SFML developer

kamac

  • Newbie
  • *
  • Posts: 19
    • View Profile
Buffer Overrun on starting a window
« Reply #6 on: January 17, 2012, 01:44:36 pm »
I'm getting link errors when trying to compile sfml-graphics.

Quote
2>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
2>Font.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::Unicode::Text::operator class std::basic_string<unsigned int,struct std::char_traits<unsigned int>,class std::allocator<unsigned int> > const &(void)const " (??BText@Unicode@sf@@QBEABV?$basic_string@IU?$char_traits@I@std@@V?$allocator@I@2@@std@@XZ) referenced in function "public: bool __thiscall sf::Font::LoadFromFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int,class sf::Unicode::Text const &)" (?LoadFromFile@Font@sf@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IABVText@Unicode@2@@Z)
2>String.obj : error LNK2001: unresolved external symbol "public: __thiscall sf::Unicode::Text::operator class std::basic_string<unsigned int,struct std::char_traits<unsigned int>,class std::allocator<unsigned int> > const &(void)const " (??BText@Unicode@sf@@QBEABV?$basic_string@IU?$char_traits@I@std@@V?$allocator@I@2@@std@@XZ)
2>Font.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::Unicode::Text::Text(unsigned int const *)" (??0Text@Unicode@sf@@QAE@PBI@Z) referenced in function "public: static class sf::Font const & __cdecl sf::Font::GetDefaultFont(void)" (?GetDefaultFont@Font@sf@@SAABV12@XZ)
2>String.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::Unicode::Text::Text(void)" (??0Text@Unicode@sf@@QAE@XZ) referenced in function "public: __thiscall sf::String::String(void)" (??0String@sf@@QAE@XZ)


I did use Release DLL.


@EDIT

Nevermind, i had to choose Build Solution. (F7)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Buffer Overrun on starting a window
« Reply #7 on: January 17, 2012, 01:53:49 pm »
What did you do exactly? Did you change anything?
Laurent Gomila - SFML developer

kamac

  • Newbie
  • *
  • Posts: 19
    • View Profile
Buffer Overrun on starting a window
« Reply #8 on: January 17, 2012, 02:02:38 pm »
I did build all the .dll files, but i don't know how to build all the .lib files, which wouldn't have the -s extension.

Okay, i used static libraries, and it works :)