ELETTRA-SincrotroneTrieste / cumbia-libs

Generic purpose C++ multi threaded library, C++ Tango and Epics modules, Qt components for control system graphical user interfaces
GNU General Public License v3.0
4 stars 4 forks source link

Build fails with Qt5 <5.10 #2

Open mliszcz opened 5 years ago

mliszcz commented 5 years ago

Since 862c706493 a non-static QProcess::startDetached() call is used:

https://github.com/ELETTRA-SincrotroneTrieste/cumbia-libs/blob/7366539634560cece45c47435636930dc0b4eb63/qumbia-plugins/actions-extension/cuapplicationlauncherextension.cpp#L46-L51

This function is only available in 5.10 or better [1] [2].

Q: would it be possible to use old (static) API? With following change cumbia compiles fine on Ubuntu 18.04 LTS (Qt5 5.9.5):

         else {
-            QProcess p;
-            p.setProgram(d->program);
-            p.setArguments(d->args);
-            p.startDetached();
+            QProcess::startDetached(d->program, d->args);
         }
delleceste commented 5 years ago

Hello. I've just committed fixes to README.md. I think your suggested method is OK. We are using newer Qt libraries, so I did not run into this issue. You will run into some problems with qml QtCharts if using Qt older than 5.12. In our ubuntu 18.04 we installed Qt 5.12 using the official installer.

Giacomo

delleceste commented 5 years ago

Thanks for feedback. I will apply your patch right now.

HighwayStar commented 4 years ago

Is there way to specify QT libs path? Because if I install qt5.12 from official installer and adding its qmake to PATH, it still messing up with system old Qt located in /usr/lib when linking.

delleceste commented 4 years ago

Hello. I also have parallel Qt installations (system and /usr/local/qt-...). Have you exported LD_LIBRARY_PATH properly? Even though making sure /usr/local/qt-5.12/bin/qmake is being executed should be enough.

HighwayStar commented 4 years ago

I have Qt 5.12.7 installed by online installer to /local/2TB/tomin/qt/5.12.7/gcc_64/ , but when cubuild.sh script builds la-cumparsita it links libs from -L/usr/lib64 first where system Qt located.

++ -Wl,-O1 -Wl,-rpath,/local/2TB/tomin/qt/5.12.7/gcc_64/lib -Wl,-rpath-link,/local/2TB/tomin/qt/5.12.7/gcc_64/lib -o bin/la-cumparsita obj/main.o obj/cumparsita.o obj/moc_cumparsita.o   -L/home/tomin/devel/cumbia-libs/tmp-install-dir/lib -L/usr/local/lib64 -ltango -lzmq -lCOS4 -lomniDynamic4 -lomniORB4 -lomnithread -lX11 -lcumbia -lcumbia-tango -lcumbia-qtcontrols -lqumbia-tango-controls -lqwt-qt5 -lQt5Concurrent -L/usr/lib64 -lQt5PrintSupport -lQt5Svg -lQt5OpenGL -lQt5Widgets -lQt5Gui -lQt5Core -lcumbia-random /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5OpenGL.so /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5PrintSupport.so /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5UiTools.a -L/home/qt/openssl-1.1.1d/lib /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5Widgets.so /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5X11Extras.so /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5Gui.so /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5Core.so -lGL -lpthread   
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5UiTools.a(properties.o): in function `QFormInternal::variantToDomProperty(QFormInternal::QAbstractFormBuilder*, QMetaObject const*, QString const&, QVariant const&)':
/home/qt/work/qt/qttools/src/designer/src/uitools/../lib/uilib/properties.cpp:594: undefined reference to `QString::arg(QLatin1String, int, QChar) const'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5UiTools.a(formbuilderextra.o): in function `QFormInternal::QFormBuilderExtra::readUi(QIODevice*)':
/home/qt/work/qt/qttools/src/designer/src/uitools/../lib/uilib/formbuilderextra.cpp:145: undefined reference to `QVersionNumber::fromString(QStringView, int*)'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/qt/work/qt/qttools/src/designer/src/uitools/../lib/uilib/formbuilderextra.cpp:150: undefined reference to `QString::arg(QStringView, int, QChar) const'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5Script.so.5: undefined reference to `QObjectPrivate::QObjectPrivate(int)@Qt_5_PRIVATE_API'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/tomin/devel/cumbia-libs/tmp-install-dir/lib/libcumbia-random.so: undefined reference to `QRandomGenerator::_fillRange(void*, void*)@Qt_5'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5Script.so.5: undefined reference to `QString::arg(QLatin1String, int, QChar) const@Qt_5'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/tomin/devel/cumbia-libs/tmp-install-dir/lib/libcumbia-random.so: undefined reference to `operator delete(void*, unsigned long)@Qt_5'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5Script.so.5: undefined reference to `QObject::QObject(QObjectPrivate&, QObject*)@Qt_5_PRIVATE_API'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/tomin/devel/cumbia-libs/tmp-install-dir/lib/libcumbia-random.so: undefined reference to `qt_version_tag@Qt_5.12'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5Script.so.5: undefined reference to `operator delete[](void*, unsigned long)@Qt_5'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5Script.so.5: undefined reference to `typeinfo for QObjectPrivate@Qt_5_PRIVATE_API'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/tomin/devel/cumbia-libs/tmp-install-dir/lib/libcumbia-random.so: undefined reference to `QRandomGenerator64::global()@Qt_5'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5Script.so.5: undefined reference to `QObjectPrivate::~QObjectPrivate()@Qt_5_PRIVATE_API'
delleceste commented 4 years ago

I see. What happens if you cd into la-cumparsita dir, execute the correct qmake from there and build? By the way, the linker message points to correct path:

/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5Script.so.5: undefined reference to `QObjectPrivate::QObjectPrivate(int)@Qt_5_PRIVATE_API'

and it looks like undefined references point to Qt internal libraries rather than symbol functions used by the la-cumparsita app, in particular /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5UiTools.a /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5Script.so.

I would consider reinstalling the qt libs, possibly trying another version, or see what happens building cumbia with system libs, if they are recent enough.

Thanks Giacomo.

El mié., 19 feb. 2020 a las 10:19, HighwayStar (notifications@github.com) escribió:

I have Qt 5.12.7 installed by online installer to /local/2TB/tomin/qt/5.12.7/gcc_64/ , but when cubuild.sh script builds la-cumparsita it links libs from -L/usr/lib64 first where system Qt located.

++ -Wl,-O1 -Wl,-rpath,/local/2TB/tomin/qt/5.12.7/gcc_64/lib -Wl,-rpath-link,/local/2TB/tomin/qt/5.12.7/gcc_64/lib -o bin/la-cumparsita obj/main.o obj/cumparsita.o obj/moc_cumparsita.o -L/home/tomin/devel/cumbia-libs/tmp-install-dir/lib -L/usr/local/lib64 -ltango -lzmq -lCOS4 -lomniDynamic4 -lomniORB4 -lomnithread -lX11 -lcumbia -lcumbia-tango -lcumbia-qtcontrols -lqumbia-tango-controls -lqwt-qt5 -lQt5Concurrent -L/usr/lib64 -lQt5PrintSupport -lQt5Svg -lQt5OpenGL -lQt5Widgets -lQt5Gui -lQt5Core -lcumbia-random /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5OpenGL.so /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5PrintSupport.so /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5UiTools.a -L/home/qt/openssl-1.1.1d/lib /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5Widgets.so /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5X11Extras.so /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5Gui.so /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5Core.so -lGL -lpthread /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5UiTools.a(properties.o): in function QFormInternal::variantToDomProperty(QFormInternal::QAbstractFormBuilder*, QMetaObject const*, QString const&, QVariant const&)': /home/qt/work/qt/qttools/src/designer/src/uitools/../lib/uilib/properties.cpp:594: undefined reference toQString::arg(QLatin1String, int, QChar) const' /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5UiTools.a(formbuilderextra.o): in function QFormInternal::QFormBuilderExtra::readUi(QIODevice*)': /home/qt/work/qt/qttools/src/designer/src/uitools/../lib/uilib/formbuilderextra.cpp:145: undefined reference toQVersionNumber::fromString(QStringView, int)' /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/qt/work/qt/qttools/src/designer/src/uitools/../lib/uilib/formbuilderextra.cpp:150: undefined reference to QString::arg(QStringView, int, QChar) const' /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5Script.so.5: undefined reference toQObjectPrivate::QObjectPrivate(int)@Qt_5_PRIVATE_API' /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/tomin/devel/cumbia-libs/tmp-install-dir/lib/libcumbia-random.so: undefined reference to `QRandomGenerator::_fillRange(void, void)@Qt_5' /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5Script.so.5: undefined reference to QString::arg(QLatin1String, int, QChar) const@Qt_5' /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/tomin/devel/cumbia-libs/tmp-install-dir/lib/libcumbia-random.so: undefined reference tooperator delete(void, unsigned long)@Qt_5' /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5Script.so.5: undefined reference to QObject::QObject(QObjectPrivate&, QObject*)@Qt_5_PRIVATE_API' /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/tomin/devel/cumbia-libs/tmp-install-dir/lib/libcumbia-random.so: undefined reference toqt_version_tag@Qt_5.12' /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5Script.so.5: undefined reference to operator delete[](void*, unsigned long)@Qt_5' /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5Script.so.5: undefined reference totypeinfo for QObjectPrivate@Qt_5_PRIVATE_API' /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/tomin/devel/cumbia-libs/tmp-install-dir/lib/libcumbia-random.so: undefined reference to QRandomGenerator64::global()@Qt_5' /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /local/2TB/tomin/qt/5.12.7/gcc_64/lib/libQt5Script.so.5: undefined reference toQObjectPrivate::~QObjectPrivate()@Qt_5_PRIVATE_API'

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ELETTRA-SincrotroneTrieste/cumbia-libs/issues/2?email_source=notifications&email_token=AAJED34AXVVZQQKILAWHEGDRDT2SXA5CNFSM4HER7NA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMG7LKY#issuecomment-588117419, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJED33NQHRQUDXDOMH3M23RDT2SXANCNFSM4HER7NAQ .

-- Giacomo S. http://www.giacomos.it

Sincrotrone Trieste S.C.p.A. di interesse nazionale Strada Statale 14 - km 163,5 in AREA Science Park 34149 Basovizza, Trieste ITALY

040 3758073 328 3237959