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. Strange access violation exception with qt charts
Forum Updated to NodeBB v4.3 + New Features

Strange access violation exception with qt charts

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 2 Posters 2.9k 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.
  • T Offline
    T Offline
    TheTugaOne
    wrote on 27 Feb 2018, 09:49 last edited by
    #1

    Hello , i am having trouble compiling in visual studio 2017 any examples involving a QChart :
    Unhandled exception at 0x00007FF90DBDCB4C (Qt5Gui.dll) in myproj.exe: 0xC0000005: Access violation reading location 0x0000000000000000.
    The weird part is that this error occurs whenever i create a QChart object (it doesn't matter where or when) so if i delete the line QChart *chart = new QChart(); from the example and add it in a separate class nothing changes . I have also created a new Qt project and added just the QChart module and the same thing happens.
    I have found a way to run the code and i believe it has something to do with the files generated by QtCreator : open qt creator -> build the project -> run it -> now that the program is running in qt creator i can run it in visual studio too until i make any modifications in visual studio then the same problem happens.
    Has anyone had this problem ? any help is welcome!

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 27 Feb 2018, 18:13 last edited by
      #2

      Hi
      Any chance you would have other Qt dlls in path ?
      Creator sets up path to the Qt used to build the exe.
      If VS do not use exact same paths , odd stuff can happen.

      T 1 Reply Last reply 28 Feb 2018, 12:02
      3
      • M mrjj
        27 Feb 2018, 18:13

        Hi
        Any chance you would have other Qt dlls in path ?
        Creator sets up path to the Qt used to build the exe.
        If VS do not use exact same paths , odd stuff can happen.

        T Offline
        T Offline
        TheTugaOne
        wrote on 28 Feb 2018, 12:02 last edited by
        #3

        @mrjj Hi and thank you for the reply , I'm not sure which path you're referring to .
        "C:\Qt\5.10.1\msvc2017_64" this is the path that i have selected in the qt vs tools -> qt options so yes this path contains the dlls for the other modules

        M 1 Reply Last reply 28 Feb 2018, 12:29
        0
        • T TheTugaOne
          28 Feb 2018, 12:02

          @mrjj Hi and thank you for the reply , I'm not sure which path you're referring to .
          "C:\Qt\5.10.1\msvc2017_64" this is the path that i have selected in the qt vs tools -> qt options so yes this path contains the dlls for the other modules

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 28 Feb 2018, 12:29 last edited by
          #4

          @TheTugaOne
          Hi
          I mean from some other Qt application or multiple version of Qt etc.
          It sounds like you/the app might find wrong version sometimes.
          Else im not sure how it can work sometimes and sometimes not.

          T 1 Reply Last reply 28 Feb 2018, 12:55
          2
          • M mrjj
            28 Feb 2018, 12:29

            @TheTugaOne
            Hi
            I mean from some other Qt application or multiple version of Qt etc.
            It sounds like you/the app might find wrong version sometimes.
            Else im not sure how it can work sometimes and sometimes not.

            T Offline
            T Offline
            TheTugaOne
            wrote on 28 Feb 2018, 12:55 last edited by
            #5

            @mrjj The application doesn't work constantly , as i mentioned every time i create a QChart object and i try to run it i get the access violation exception . What i wrote in the last paragraph is a workaround i found.
            My problem is very similar to the one posted on this thread https://forum.qt.io/topic/84500/qt-charts-access-violation-exception which was also unresolved.

            1 Reply Last reply
            0
            • T Offline
              T Offline
              TheTugaOne
              wrote on 7 Mar 2018, 10:40 last edited by
              #6

              If anyone is reading this in the future i managed to resolve the problem by removing qt5charts.dll from the additional dependencies ,leaving only qt5chartsd.dll . Steps: right click on project -> properties -> configuration properties ->linker -> input -> modify additional dependencies and remove Qt5Charts.dll
              I'm not sure what the problem was so if anyone has any idea what caused the errors then please leave a reply.

              M 1 Reply Last reply 7 Mar 2018, 11:20
              3
              • T TheTugaOne
                7 Mar 2018, 10:40

                If anyone is reading this in the future i managed to resolve the problem by removing qt5charts.dll from the additional dependencies ,leaving only qt5chartsd.dll . Steps: right click on project -> properties -> configuration properties ->linker -> input -> modify additional dependencies and remove Qt5Charts.dll
                I'm not sure what the problem was so if anyone has any idea what caused the errors then please leave a reply.

                M Offline
                M Offline
                mrjj
                Lifetime Qt Champion
                wrote on 7 Mar 2018, 11:20 last edited by
                #7

                @TheTugaOne
                Hi
                The DLLS with d in name are debug version of the dll.

                Mixing release code and debug code can also crash.

                1 Reply Last reply
                4

                1/7

                27 Feb 2018, 09:49

                • Login

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