[Qt-interest] Qt with x64 computer
Ian Thomson
Ian.Thomson at iongeo.com
Thu Jan 8 17:28:32 CET 2009
Hi,
I think his suggestion is good. Your crash is happening during the
destruction of a std::string which definitely should not happen. A
library mismatch would explain it.
Also, you can get a const char* from a std::string by using its function
.c_str().
Can you check what versions of libraries you are linking against, and
what versions your Qt build is linked against etc...
Cheers,
Ian.
P B wrote:
> Hi Ender,
>
> the content of StdStrg is correct after the toStdString() command. I
> tried your suggestion just to see but it gives me errors at compile
> time, errors of the form impossible to cast std::string into const char*,
>
> Thanks for the suggestion though,
> Pascale
>
> > From: erelender at yahoo.com
> > Date: Thu, 8 Jan 2009 17:47:31 +0200
> > To: qt-interest at trolltech.com
> > Subject: Re: [Qt-interest] Qt with x64 computer
> >
> > I've had a similar problem before, i think your problem might be the
> > same as mine.
> >
> > As far as i could find out, std::string has different structure in debug
> > mode than in release mode. If your program gets linked with the wrong
> > version (release mode std::string with debug mode app), the value that
> > .toStdString() returns is invalid, and the resulting string is
> > corrupted, and therefore causes a crash while deletion.
> >
> > In your case, check the value of StdStrg after the assignment. If it
> > seems to have a garbage value, your problem might be this. I couldn't
> > figure out a way to resolve this issue, but i found a workaround.
> >
> > std::string StdStrg = (const char*)loadfile.toAscii();
> > This line of code seemed to do the trick for me. Hope this helps you.
> >
> > --
> > ender
> > _______________________________________________
> > Qt-interest mailing list
> > Qt-interest at trolltech.com
> > http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
> ------------------------------------------------------------------------
> Share your holiday memories for free with Windows LiveT Photos. Get
> started now. <http://www.microsoft.com/windows/windowslive/photos.aspx>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
This email and any files transmitted with it are confidential and are intended solely for the use of the individual or entity to whom they are addressed. If you are not the original recipient or the person responsible for delivering the email to the intended recipient, be advised that you have received this email in error, and that any use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. If you received this email in error, please immediately notify the sender and delete the original.
More information about the Qt-interest-old
mailing list