Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. fromStdString and toStdString msvc2017 debug
Forum Updated to NodeBB v4.3 + New Features

fromStdString and toStdString msvc2017 debug

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 632 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Andaharoo
    wrote on last edited by
    #1

    I recently switched from vs2015 to vs2017 after spending a few hours setting up my dev env. But now I have a very strange problem. All my code works except for conversion from QString to and from std string. And only on my debug configuration. My release runs fine.

    It throws a read access violation. The stack frame looks like this:
    Qt5Core.dll!QString::fromStdString(...)
    Qt5Core.dll!QString::fromUtf8(...)
    Qt5Core.dll!QString::fromUtf8(...)
    Qt5Core.dll!QString::fromUtf8_helper(...)
    Qt5Core.dll!QUtf8::convertToUnicode(...)
    Qt5Core.dll!QUtf8::convertToUnicode(...) breaks here

    If I use another technique it works fine. I've been using QString::toLocal8Bit().constData() to get a cstr temporarily while I try to figure out the problem. I tried reinstalling qt as well.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      The best thing to do is to move to Qt 5.9.0. There's already a pre-built package for VS2017.

      IIRC, there's was compatibility problem with the MSVC2015 5.8 package and MSVC2017 but that was fixed for 5.9.0.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved