TGUI Causing Crash in SFML Graphics library.

Started by Strikerklm96, 21 October 2014, 00:35:47

Strikerklm96

I really like TGUI, so great job on it  ;D

I just switched to using this as my compiler: https://sourceforge.net/projects/mingw-w64
After rebuilding SFML and TGUI, SFML works fine, but if I try and do anything with TGUI, I get a crash in the SFML Graphics library:


There was a bunch of steps that lead up to this post, which can be seen in this SFML thread:
https://en.sfml-dev.org/forums/index.php?topic=16579.0

I'm pretty sure (can I get a confirmation?) that this compiler uses DW2. I thought that rebuilding TGUI would allow it to work. What is the problem?
Thanks

eXpl0it3r

You should switch to debug mode and debug libraries and get a proper call stack. :)

Strikerklm96

#2
Ok, so since we were compiling with the same compiler, we assumed our libs would be the same (as you indicated correctly) so I was trying to use his libs, so we were both getting the error.
I rebuilt my libs, and everything works on my machine.

We looked at the file sizes of the libs he was building, and his sfml-window-2.dll file was 146KB, while mine is 830KB. Everything else was different too, shouldn't they be the same? Also, he is Windows 8, I'm windows 7.

We double, triple, and quadruple checked his CMake settings. I also had him download the exact same SFML source I downloaded. We are currently working on getting everything in debug mode to get the callstack.

Strikerklm96

Strangely, it works fine in Debug mode, but not in Release. Only his computer has this problem.

eXpl0it3r

You should be able to share the binaries, but in the end it's probably better if everyone build their own.

texus

Everything relevant has already been mentioned by eXpl0it3r.

There must still be a configuration mistake on his pc then.
Since debug works and release does not, you should make sure that the release settings don't still use a library that was build with another compiler. Also check that you use the right dll files in release.

If you have multiple sfml and tgui folders you should remove them to make sure that you can't be using the wrong one accidentally. And make sure that all dll files are coming from these folders.

Somewhere, something is still misconfigured. You just have to find out where :).

And indeed, you could just give your libraries to your friend to make it work. But I agree with eXpl0it3r that it might be better if he can build his own libs. But it is an option if you really can't figure it out.

Strikerklm96

Quote from: texus on 21 October 2014, 10:21:03If you have multiple sfml and tgui folders you should remove them to make sure that you can't be using the wrong one accidentally. And make sure that all dll files are coming from these folders.

We actually went through and did exactly that step :/ I we will go through again though just to make sure.

Quote from: texus on 21 October 2014, 10:21:03There must still be a configuration mistake on his pc then.

Here are all the things I know how to check:
All CMake settings (we checked Advanced too)
Code::Blocks Compiler settings: Settings->Compiler->Toolchain Executables (his match mine)
Path Environment Variables: I understand what these do, should I check for anything? In the past he had a misconfigured MinGW directory, which was causing a different problem, so we made the only MinGW/bin variable point at the new correct one.

What other things can I check for?

And thank you both for your input!

texus

I always used the MinGW compiler that is shipped with CodeBlocks and I never installed a different one. So I can't give you much advise.

If you are sure that your PATH variable does not contain another mingw directory, then you should try clearing the cmake cache and rebuild again. Maybe it cached some old directory.

You are using separate build folders for the debug and release mode, right? There used to be a caching problem when switching from debug to release without deleting the cache. It is fixed in sfml by now but I never tested whether it really is fixed with my unchanged tgui cmake script. But if you use separate directories, like you should, then this can't be a problem.

Do the files still have a different size? If they have then you shouldn't be looking at the codeblocks settings.
If they are the same size then you could try replacing his dll files by yours. If that work then it means he has been using dll files from a wrong folder.

The smallest mistake can have disastrous consequences. But there has to be some mistake, the fact that it runs on your pc proves this.