[Solved]Using QCA results in segmentation fault
-
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
-
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? -
Another thing, are you sure that all libraries are found when you start your program ?
-
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.
-
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
-
Errr... could you please tell me how to do that?
- This is the first time I'm manually linking to external libraries...
-
run ldd youApplicationExecutable and look at the output for missing libraries
-
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)@ -
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...
-
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.5So 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 :)