[Interest] Exception during ASCII cast on windows

Frédéric Martinsons frederic.martinsons at gmail.com
Tue Oct 23 09:49:37 CEST 2012


Hello again,

there was an object constructed which called an external library which made
poorly "std::string currentPath=getenv("PWD") " ... Of course under cygin,
PWD is defined while it is not under windows termninal.

Sorry for the noise.

2012/10/22 Frédéric Martinsons <frederic.martinsons at gmail.com>

> Hello,
>
> I've an application which runs nicely on linux (Qt 4.7.3 gcc 4.1.2 32
> bits) and I want it to run on windows XP 32 bits. So I've been built it
> inside eclipse (not my choice, it is part of a bigger C++ project),
> everything was fine until I want to execute it. It crashed poorly giving me
> the following exception:
>
> terminate called after throwing an instance of  "std::logic_error"
> what() : basic_string::_S_construct NULL not valid.
>
> I've checked that all of my char* are not NULL before casting them into
> QString. Anyway running into debugger tells me it's the following line
> which seems to be the culprit:
>
> CommandLinkPOS2::CommandLinkPOS2(const QString& serverName,unsigned short
> port) : CommandLink(QString(POS2_CMD),serverName,port)
>
> And especially in qtring.h at line : inline QT_ASCII_CAST_WARN_CONSTRUCTOR
> QString(const char *ch) : d(fromAscii_helper(ch)
>
> The parent constructor is called well but it seems the exception is
> launched after it (the POS2_CMD symbols is #define POS2_CMD "POS2"). The
> build on windows is done against Qt 4.7.3 with mingw 5.1.8 (gcc 4.5.2).
> The gcc version is newer than the one used on linux, but I'd not expected
> such problem.
>
> There is one more strange behaviour. The executable produced runs as
> expected under a cygwin environment but it launches an exception under
> cmd.exe or if I double click it.
>
> Have you any clue of what is going on here. Any hint would be greatly
> appreciate because I'm stuck.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20121023/96ae5da9/attachment.html>


More information about the Interest mailing list