Planned maintenance: From Sunday 8th December 10:00 CET there will be changes to try and solve the caching issues that have been experienced. If anyone has a problem connecting after this period then please PM @AndyS or any of the moderators.

Deployed app on Windows crashes when generating graphs- Qt 5.7.1

  • So, I built an app on MS Visual Studio 2017 with Qt 5.7.1 for the GUI. The GUI is supposed to load and display graphs and analytics. It works perfectly fine on my laptop and generates and displays graphs but crashes on the PC on which it is deployed the moment graph generation starts.

    I am guessing it could be a dependency issue but I can't figure it out. I tried out this: but it crashes at the initial deployment stage itself.

    Any help with this would be appreciated.

    Note: My laptop has Qt installed but the target PC doesn't. I have added all the Qt dependent .dll files (Qt5Core, Qt5Widgets, Qt5Gui, Qt5Xml, Qt5PrintSupport)

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Can you trigger the crash on your machine if you execute the application directly from the explorer ?

  • @SGaist Yes, I can.
    So here's when the graph generation works:

    1. When I run the program in Debug mode on Visual Studio
    2. When I run the .exe file of the app from the Debug folder
    3. Works sometimes when I run it in Release mode on Visual Studio, crashes sometimes (Exception thrown: read access violation. QCustomPlot::graph(...) returned nullptr)

    When it absolutely doesn't work:

    1. When I run the .exe file of the app in the Release folder
    2. Crashes sometimes when run in Release mode on Visual Studio (Exception thrown: read access violation. QCustomPlot::graph(...) returned nullptr)

    I can't seem to figure out why doesn't the QCustomPlot::graph() error show up in debug mode. Also, how do I resolve that error? Any help on this would be appreciated.

    PS - Do let me know if you need to know any more details

  • Lifetime Qt Champion

    I'd first check that all member variables are initialised correctly.

Log in to reply