c++ - Static Library - Static library using own Qt .so file -
i want compile static library qt project version 4.7.4. whatever i'm changing in .pro
file not affecting on changes. want change example libqt5gui.so
point on /opt/vendor/extlib/libqt5gui.so
, i'm not lucky @ moment:
i'm copying files ubuntu virtual machine on cleanly installed xubuntu 13.04.
when i'm using ldd
command returns:
marin@host:~/some_dir/test$ ldd ./project02 linux-gate.so.1 => (0xb76e7000) libqt5widgets.so.5 => /usr/lib/i386-linux-gnu/libqt5widgets.so.5 (0xb70c6000) libqt5xml.so.5 => /usr/lib/i386-linux-gnu/libqt5xml.so.5 (0xb708a000) libqt5gui.so.5 => not found libqt5core.so.5 => not found libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xb6fa0000) libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb6f83000) libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb6dd0000) libqt5gui.so.5 => not found libqt5core.so.5 => not found libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb6db4000) libgobject-2.0.so.0 => /usr/lib/i386-linux-gnu/libgobject-2.0.so.0 (0xb6d64000) libglib-2.0.so.0 => /lib/i386-linux-gnu/libglib-2.0.so.0 (0xb6c63000) libx11.so.6 => /usr/lib/i386-linux-gnu/libx11.so.6 (0xb6b2c000) libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb6ae9000) /lib/ld-linux.so.2 (0xb76e8000) libqt5core.so.5 => not found libffi.so.6 => /usr/lib/i386-linux-gnu/libffi.so.6 (0xb6ae2000) libpcre.so.3 => /lib/i386-linux-gnu/libpcre.so.3 (0xb6aa1000) libxcb.so.1 => /usr/lib/i386-linux-gnu/libxcb.so.1 (0xb6a7e000) libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb6a79000) libxau.so.6 => /usr/lib/i386-linux-gnu/libxau.so.6 (0xb6a75000) libxdmcp.so.6 => /usr/lib/i386-linux-gnu/libxdmcp.so.6 (0xb6a6e000)
so you, didn't figure why is:
libqt5gui.so.5 => not found libqt5core.so.5 => not found
my .pro
file:
qt += core gui xml greaterthan(qt_major_version, 4): qt += widgets target = project02 template = app sources += main.cpp\ mainwindow.cpp \ editorplain.cpp \ logssession.cpp \ createcontroller.cpp \ createmodel.cpp \ createview.cpp \ envview.cpp \ properties.cpp \ debugsettings.cpp \ serverconf.cpp \ frameworkview.cpp \ helpergen.cpp \ offlineserver.cpp \ cssproperty.cpp \ regex.cpp \ formgen.cpp headers += mainwindow.h \ editorplain.h \ logssession.h \ createcontroller.h \ createmodel.h \ createview.h \ envview.h \ properties.h \ debugsettings.h \ serverconf.h \ frameworkview.h \ helpergen.h \ offlineserver.h \ cssproperty.h \ regex.h \ formgen.h forms += mainwindow.ui \ editorplain.ui \ logssession.ui \ createcontroller.ui \ createmodel.ui \ createview.ui \ envview.ui \ properties.ui \ debugsettings.ui \ serverconf.ui \ frameworkview.ui \ helpergen.ui \ offlineserver.ui \ cssproperty.ui \ regex.ui \ formgen.ui resources += \ res.qrc config += staticlib libs += -l$$pwd/extstaticlibs/ -lfoobar includepath += $$pwd/extstaticlibs
in .pro
file i've added only:
config += staticlib libs += -l$$pwd/extstaticlibs/ -lfoobar includepath += $$pwd/extstaticlibs
on $$pwd/extstaticlibs there copy files of libqt5gui.so.5
.
so, have make static library works without dynamic shared .so
qt scripts standalone app? thank you!
i solved question. using g++ --static --release
, compile minigw under windows machine solved problem. recommended version use shared library of qt due better support qt libraries.
i solved problem in unix too, using deb package , addding shared library libqt5gui
, libqt5core
.
for static library i'm not solved yet, not recommend using solution due incompatible gcc
version , c++ compiler on other platforms. prevents screwing of compile codes.
Comments
Post a Comment