SFML community forums

Help => General => Topic started by: blojayble on August 30, 2013, 10:22:02 pm

Title: String iterators incompatibile
Post by: blojayble on August 30, 2013, 10:22:02 pm
Hi.

I was making my SFML app, and everything was all right when i compiled it in release mode, but when I tried debug, an weird error occurred. It shows when app is already working and refers to xstring file:

Program: C:\Windows\system32\MSVCP110D.dll
File: D:\programmes\visual-studio-2012\VC\INCLUDE\xstring
Line: 250

Expression: string iterators incompatible
 

By debugging I found what triggers that error:

void ThreadedRenderWin::create_(sf::VideoMode mode_, const std::string& title_, unsigned long style_, const sf::ContextSettings& settings_)
        {
                eventThread.reset(new sf::Thread([&]()
                {
                        sf::Lock createLock(createMutex);
                        sf::RenderWindow::create(mode_, title_, style_, settings_); //<-- This is the problematic function
                        setActive(false);
                       
                //Rest omitted
                }));
                eventThread->launch();
        }

//////main.cpp

int main(){
        NG::ThreadedRenderWin RenderWin;
        RenderWin.create_(sf::VideoMode(800,680,32), "SFML");
       

//Event loop etc.


        return 0;
}
 


Still, in release there is no problem.
I don't know what is exactly wrong, so I put it in "General" category.

Any ideas? I use VS2012.

Thanks for every response!
Title: Re: String iterators incompatibile
Post by: Laurent on August 30, 2013, 10:25:07 pm
In debug mode, link to the Debug SFML libraries.
Title: Re: String iterators incompatibile
Post by: blojayble on August 30, 2013, 10:32:26 pm
Well, I checked even twice and I'm linking proper libs.

tbh, my earlier "app" worked without problems in debug mode.
Title: Re: String iterators incompatibile
Post by: eXpl0it3r on August 31, 2013, 01:38:44 am
Have you accidentally chosen /MD or /MT as your runtime library for debug mode?
Have you tried a clean rebuild?
Title: Re: String iterators incompatibile
Post by: blojayble on August 31, 2013, 03:11:51 pm
Clean rebuild did not helped, also I checked my runtime lib and it is Multhi-Threaded Debug DLL (/MDd). Changing to other options does not fix anything of course.

@Well, later problem just disappeared, strange though.