Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [Solved]Using QCA results in segmentation fault
Forum Updated to NodeBB v4.3 + New Features

[Solved]Using QCA results in segmentation fault

Scheduled Pinned Locked Moved Installation and Deployment
11 Posts 2 Posters 5.8k 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.
  • S Offline
    S Offline
    SGaist
    Lifetime Qt Champion
    wrote on 19 Jul 2013, 20:13 last edited by
    #2

    Hi and welcome to devnet,

    After a quick read of an example:

    change

    @QCA::Initializer init = QCA::Initializer();@

    by

    @QCA::Initializer init;@

    Hope it helps

    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
    0
    • K Offline
      K Offline
      kaziwaseef
      wrote on 19 Jul 2013, 20:30 last edited by
      #3

      Thank you for the quick reply... however I tried
      @QCA::Initializer init;@
      And even
      @QCA::Initializer * init = new QCA::Initializer();@
      But the same erroe is happening.

      Another interesting thing is that even if I remove the
      @LIBS += -L$$PWD/usr/lib/i386-linux-gnu -lqca@
      from the .pro file the same thing is happening. Does this mean that the library is not loading?

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 19 Jul 2013, 20:41 last edited by
        #4

        Another thing, are you sure that all libraries are found when you start your program ?

        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
        0
        • K Offline
          K Offline
          kaziwaseef
          wrote on 19 Jul 2013, 21:03 last edited by
          #5

          This is the compiler output
          @03:02:29: Running steps for project umail...
          03:02:29: Starting: "/usr/bin/qmake" '/home/kaziwaseef/QML/Ubuntu Phone App/umail/umail/umail.pro' -r -spec linux-g++ CONFIG+=debug CONFIG+=declarative_debug CONFIG+=qml_debug
          03:02:29: The process "/usr/bin/qmake" exited normally.
          03:02:29: Starting: "/usr/bin/make"
          Copying application data...
          03:02:29: The process "/usr/bin/make" exited normally.
          03:02:29: Elapsed time: 00:00.@

          Everything seems to compile ok.... any other tests that I can perform???

          Thank you.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 19 Jul 2013, 21:08 last edited by
            #6

            Not the compilation, the application itself, check that it can find all libraries when starting (not the same as when linking) i.e using ldd

            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
            0
            • K Offline
              K Offline
              kaziwaseef
              wrote on 19 Jul 2013, 21:16 last edited by
              #7

              Errr... could you please tell me how to do that?

              • This is the first time I'm manually linking to external libraries...
              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 19 Jul 2013, 22:11 last edited by
                #8

                run ldd youApplicationExecutable and look at the output for missing libraries

                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
                0
                • K Offline
                  K Offline
                  kaziwaseef
                  wrote on 20 Jul 2013, 03:43 last edited by
                  #9

                  Thank you for the help. This is the output of ldd. Line 2 shows that libqca loads but I was expecting libqca.so.2.0.3

                  @linux-gate.so.1 => (0xb7729000)
                  libqca.so.2 => /usr/lib/i386-linux-gnu/libqca.so.2 (0xb7613000)
                  libQt5Quick.so.5 => /usr/lib/i386-linux-gnu/libQt5Quick.so.5 (0xb72d9000)
                  libQt5Qml.so.5 => /usr/lib/i386-linux-gnu/libQt5Qml.so.5 (0xb7099000)
                  libQt5Network.so.5 => /usr/lib/i386-linux-gnu/libQt5Network.so.5 (0xb6f5d000)
                  libQt5Gui.so.5 => /usr/lib/i386-linux-gnu/libQt5Gui.so.5 (0xb6b7f000)
                  libQt5Core.so.5 => /usr/lib/i386-linux-gnu/libQt5Core.so.5 (0xb674b000)
                  libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xb6662000)
                  libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb6644000)
                  libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb6491000)
                  libQtCore.so.4 => /usr/lib/i386-linux-gnu/libQtCore.so.4 (0xb61a9000)
                  libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb618e000)
                  libQt5V8.so.5 => /usr/lib/i386-linux-gnu/libQt5V8.so.5 (0xb5d71000)
                  libGL.so.1 => /usr/lib/nvidia-313-updates/libGL.so.1 (0xb5c90000)
                  libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb5c4d000)
                  libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xb5c34000)
                  libpng12.so.0 => /lib/i386-linux-gnu/libpng12.so.0 (0xb5c0b000)
                  libicui18n.so.48 => /usr/lib/i386-linux-gnu/libicui18n.so.48 (0xb5a37000)
                  libicuuc.so.48 => /usr/lib/i386-linux-gnu/libicuuc.so.48 (0xb58d1000)
                  libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb58cc000)
                  libglib-2.0.so.0 => /lib/i386-linux-gnu/libglib-2.0.so.0 (0xb57cb000)
                  librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xb57c2000)
                  /lib/ld-linux.so.2 (0xb772a000)
                  libnvidia-tls.so.313.30 => /usr/lib/nvidia-313-updates/tls/libnvidia-tls.so.313.30 (0xb57be000)
                  libnvidia-glcore.so.313.30 => /usr/lib/nvidia-313-updates/libnvidia-glcore.so.313.30 (0xb3a7b000)
                  libX11.so.6 => /usr/lib/i386-linux-gnu/libX11.so.6 (0xb3944000)
                  libXext.so.6 => /usr/lib/i386-linux-gnu/libXext.so.6 (0xb3932000)
                  libicudata.so.48 => /usr/lib/i386-linux-gnu/libicudata.so.48 (0xb27c1000)
                  libpcre.so.3 => /lib/i386-linux-gnu/libpcre.so.3 (0xb2780000)
                  libxcb.so.1 => /usr/lib/i386-linux-gnu/libxcb.so.1 (0xb275d000)
                  libXau.so.6 => /usr/lib/i386-linux-gnu/libXau.so.6 (0xb2759000)
                  libXdmcp.so.6 => /usr/lib/i386-linux-gnu/libXdmcp.so.6 (0xb2752000)@

                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    kaziwaseef
                    wrote on 20 Jul 2013, 10:53 last edited by
                    #10

                    I really dont know what is wrong. Will try to fix it if I I have time... In the meantime I got crypto++ working so I'll use that :)

                    However, I wish to find out what went wrong with QCA, for knowledge's sake...

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 20 Jul 2013, 19:19 last edited by
                      #11

                      Haaaaaaaaaaaaaaa ! I've forgot that you where using Qt 5...
                      Then the answer is simple:
                      You are building your software using Qt 5 and you are linking to your system's qca which is built with Qt 4 so what you get is a binary that will load Qt 5 and Qt 4 in the same address space so they will collide and then the crash.

                      If you take a closer look at ldd's output (i.e using | grep libQt) you'll see this:
                      libQt5Quick.so.5
                      libQt5Gui.so.5
                      libQt5Core.so.5
                      libQtCore.so.4 <- There's the clue
                      libQt5V8.so.5

                      So you have two solutions:

                      build your own qca with your Qt 5 and use that one

                      build your software with Qt 4

                      Hope it shed some lights :)

                      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
                      0

                      11/11

                      20 Jul 2013, 19:19

                      • Login

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