I'm trying to create shared library (with CMake) which uses Qt objects (in particular QString and QQueue) inside and using this library with other application. The problem is that application recieves SIGSEGV when it calls methods of QQueue:
(gdb) r
Starting program: /home/ilya/projects/qtLogger/build/qtLoggerSample
[Thread debugging using libthread_db enabled]
startup
_DEBUG
QtLogger::QtLogger()
void QtLogger::foo(void*)
void QtLogger::log(QtLogger::LOG_LEVEL, QString) lvl: DEBUGmsg: "debug 1"
Program received signal SIGSEGV, Segmentation fault.
0x08049450 in QString (this=0x2817ad9c, other=...) at /usr/include/qt4/QtCore/qstring.h:714
714 inline QString::QString(const QString &other) : d(other.d)
(gdb) bt
#0 0x08049450 in QString (this=0x2817ad9c, other=...) at /usr/include/qt4/QtCore/qstring.h:714
#1 0xb7fdda0c in QList<QString>::node_construct (this=0x804b474, n=0x2817ad9c, t=...) at /usr/include/qt4/QtCore/qlist.h:352
#2 0xb7fdd7fa in QList<QString>::append (this=0x804b474, t=...) at /usr/include/qt4/QtCore/qlist.h:481
#3 0xb7fdd5e0 in QQueue<QString>::enqueue (this=0x804b474, t=...) at /usr/include/qt4/QtCore/qqueue.h:59
#4 0xb7fdd19f in QtLogger::log (this=0x804b460, level=QtLogger::LL_DEBUG, message=...)
at /home/ilya/projects/qtLogger/lib-qtLogger/src/libqtlogger.cpp:97
#5 0x08049099 in main (argc=1, argv=0xbffff644) at /home/ilya/projects/qtLogger/src/main.cpp:27
Source code of application can be found here: https://github.com/ilardm/qtLoggerSample/tree/137adee556f41eb4526e1d1c604e8541ef6eb65a
Source code of library can be found here(also available as git submodule of application repository): https://github.com/ilardm/lib-qtLogger/tree/bf1b490fd7c6666176c23e6fd791c00937d954b4
Could you please help me to understand where I'am wrong?
P.S. I'm using Qt 4.6.3, Debian Squeeze x86 and x64, gcc 4.4.5
QQueueorQListin either of the repositories you linked.