instant runtime hanging with LoadFromFile example
« on: 13 December 2015, 17:53:17 »
Hi. this example hangs during runtime, below is info from VS debugger.

  • VS2015
  • TGUI 0.69 (VC12 32bit)
  • SFML 2.3.2 (VC14 32bit)
Code: [Select]
Unhandled exception at 0x00E82707 (sfml-system-d-2.dll) in tgui-test.exe: 0xC0000005: Access violation reading location 0xCCCCCCD8.
Exception thrown at 0x00E82707 (sfml-system-d-2.dll) in tgui-test.exe: 0xC0000005: Access violation reading location 0xCCCCCCD8.

Is there some details i have missed?

*

texus

  • *****
  • 1143
    • View Profile
    • Texus's Blog
Re: instant runtime hanging with LoadFromFile example
« Reply #1 on: 13 December 2015, 17:55:30 »
Quote
VC12
VC14
That is not going to work. On windows the c++ compiler you use for your program has to be the same one as all your libraries. You can't combine libraries meant for different visual studio compilers. It could lead to random behavior so this might be your problem.

Re: instant runtime hanging with LoadFromFile example
« Reply #2 on: 13 December 2015, 18:04:32 »
Replaced SFML with the VC12 version, it just changes the problem slightly:
Code: [Select]
Unhandled exception at 0x0FC3FA96 (sfml-system-d-2.dll) in tgui-test.exe: 0xC0000005: Access violation reading location 0xCCCCCCD8.
Exception thrown at 0x0FC3FA96 (sfml-system-d-2.dll) in tgui-test.exe: 0xC0000005: Access violation reading location 0xCCCCCCD8.

*

texus

  • *****
  • 1143
    • View Profile
    • Texus's Blog
Re: instant runtime hanging with LoadFromFile example
« Reply #3 on: 13 December 2015, 18:05:45 »
But are you still using VS2015? Because then the libraries are still not compatible with the compiler.

Re: instant runtime hanging with LoadFromFile example
« Reply #4 on: 13 December 2015, 18:16:53 »
Oh. i thought what was a minimum version required. I have previously been using borland devcpp with a build setup pointing to the vs12/14 compiler so switching IDE takes some time...
« Last Edit: 13 December 2015, 18:18:39 by Hexile »

*

texus

  • *****
  • 1143
    • View Profile
    • Texus's Blog
Re: instant runtime hanging with LoadFromFile example
« Reply #5 on: 13 December 2015, 18:40:17 »
The libraries have to match the compiler. And it not only the version, the settings have to be correct as well. There are settings which if you change them, you are required to recompile all libraries with that setting changed as well. That is one of the big downsides of programming with c++ in windows (at least with visual c++ or mingw, I don't know anything about borlands). C is more compatible between compiler versions but in VS2015 they even broke the C ABI meaning that even most C libraries also have to be recompiled (but this is a one time change to get their universal apps so at least they have an excuse for that).
On linux (and probably on mac too) you can mostly combine any compiler with any settings (but you still need separate 32bit and 64bit binaries). This together with having standard paths (you don't have to tell the compiler where to find the headers and library files) is why I prefer working on linux. Of course linux has its own problems (like the linker by default not looking in the directory where custom compiled libraries are installed by default), but I still think that they are less frustrating than on windows. I'm sure there is a good reason why it is incompatible on windows with every version and that this reason probably has to do with decisions made a long time ago but I still find it stupid that other systems can manage to keep library compatibility while windows just can't.