[Qt-interest] Making a Qt program into a dynamic library
Guido Seifert
Wargand at gmx.de
Wed Dec 16 14:48:33 CET 2009
> I'll answer anyway, since more is amiss here...
>
> The extern "C" should not matter since your loader does not access the
> symbols.
Believe me, it is. I can reproduce the crash by adding and removing this single line. Does not make much sense, I'd expect linker errors because of not found symbols, but no segfaults in such an early stage. Unfortunately my expectations and reality do not always agree.
> > CONFIG += qtcore
>
> I'm not sure what the above does - it should not be necessary.
It isn't. A relict of several of my experiments.
> > CONFIG -= thread
>
> Hmm. This should neither be necessary, nor wise. Qt4 has threads compiled
> in mandatorily (except one one or two embedded systems).
Also not necessary. Was an experiment. I did it because the last line I could recognised in the core file was thread related. Just wanted to see what happened when I 'unconfigured' thread. Did not make a difference.
> > CONFIG += shared
> >
> > TEMPLATE = lib
> > MOC_DIR = ./.moc
> > OBJECTS_DIR = ./.obj
>
> ok, but the TARGET directive is missing
Not necessary. Default is fine.
> ....
> gcc -o m mymain.c -ldl
> works fine for me
For me too. Now with the 'extern "C"' line. Without: crash.
And as I wrote, I can reliably toggle the segfault by commenting in and out this line.
Guido
--
Preisknaller: GMX DSL Flatrate für nur 16,99 Euro/mtl.!
http://portal.gmx.net/de/go/dsl02
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
More information about the Qt-interest-old
mailing list