radiomanV / TL866

Open source software for TL866
GNU General Public License v2.0
345 stars 80 forks source link

Won't compile on a Raspberry Pi 400 with 32 Bit ARM #31

Closed jbrunk1966 closed 5 months ago

jbrunk1966 commented 3 years ago
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o main.o main.cpp
In file included from /usr/include/arm-linux-gnueabihf/c++/8/bits/os_defines.h:39,
                 from /usr/include/arm-linux-gnueabihf/c++/8/bits/c++config.h:508,
                 from /usr/include/c++/8/utility:68,
                 from /usr/include/c++/8/algorithm:60,
                 from /usr/include/qt4/QtCore/qglobal.h:68,
                 from /usr/include/qt4/QtCore/qnamespace.h:45,
                 from /usr/include/qt4/QtCore/qobjectdefs.h:45,
                 from /usr/include/qt4/QtGui/qwindowdefs.h:45,
                 from /usr/include/qt4/QtGui/qwidget.h:46,
                 from /usr/include/qt4/QtGui/qmainwindow.h:45,
                 from /usr/include/qt4/QtGui/QMainWindow:1,
                 from mainwindow.h:4,
                 from main.cpp:23:
/usr/include/features.h:424:12: fatal error: sys/cdefs.h: No such file or directory
 #  include <sys/cdefs.h>
            ^~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:277: main.o] Error 1
radiomanV commented 3 years ago

Looks like a missing header. What Linux distro do you have on that Raspberry? The cdefs.h comes with libc6. I think you must install the 32 Bit libc6 dev library or g++ multilib an try again.

jbrunk1966 commented 3 years ago

Looks like a missing header. What Linux distro do you have on that Raspberry? The cdefs.h comes with libc6. I think you must install the 32 Bit libc6 dev library or g++ multilib an try again.

it's running Debian Buster 10.6 but as mentioned above it's ARM not x86. The needed developing libs are present:

brunk@pi400:~/tmp/TL866/TL866_Updater/QT $ LC_ALL=C dpkg -l libc6-dev
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name            Version      Architecture Description
+++-===============-============-============-=====================================================
ii  libc6-dev:armhf 2.28-10+rpi1 armhf        GNU C Library: Development Libraries and Header Files

even the include files seems to be present

brunk@pi400:~/tmp/TL866/TL866_Updater/QT $ LC_ALL=C dpkg -L libc6-dev|grep sys/c
/usr/include/arm-linux-gnueabihf/sys/cdefs.h

Tried to append /usr/include/arm-linux-gnueabihf/ into INCPATH in the Makefile but won't work

radiomanV commented 3 years ago

How do you compile? Via QtCreator or Qmake? what is the output of qmake --version?

jbrunk1966 commented 3 years ago

How do you compile? Via QtCreator or Qmake? what is the output of qmake --version?

brunk@pi400:~/tmp/TL866/TL866_Updater/QT $ qmake --version
QMake version 2.01a
Using Qt version 4.8.7 in /usr/lib/arm-linux-gnueabihf
brunk@pi400:~/tmp/TL866/TL866_Updater/QT $ qmake
brunk@pi400:~/tmp/TL866/TL866_Updater/QT $ make
jbrunk1966 commented 3 years ago

Annoying ... re-installed the libc6-dev again, and now it compiles .. a little further until this QT error:

brunk@pi400:~/tmp/TL866/TL866_Updater/QT $ qmake
brunk@pi400:~/tmp/TL866/TL866_Updater/QT $ LC_ALL=C make clean
rm -f moc_mainwindow.cpp moc_advdialog.cpp moc_editdialog.cpp moc_notifier_linux.cpp
rm -f qrc_resources.cpp
rm -f ui_mainwindow.h ui_editdialog.h ui_advdialog.h
rm -f main.o mainwindow.o advdialog.o firmware.o editdialog.o hexwriter.o crc.o usb_linux.o notifier_linux.o moc_mainwindow.o moc_advdialog.o moc_editdialog.o moc_notifier_linux.o qrc_resources.o
rm -f *~ core *.core
brunk@pi400:~/tmp/TL866/TL866_Updater/QT $ LC_ALL=C make
/usr/lib/arm-linux-gnueabihf/qt4/bin/uic mainwindow.ui -o ui_mainwindow.h
/usr/lib/arm-linux-gnueabihf/qt4/bin/uic editdialog.ui -o ui_editdialog.h
/usr/lib/arm-linux-gnueabihf/qt4/bin/uic advdialog.ui -o ui_advdialog.h
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o main.o main.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o mainwindow.o mainwindow.cpp
mainwindow.cpp: In member function 'QByteArray MainWindow::get_resource(const QString&, int)':
mainwindow.cpp:400:15: error: 'class QResource' has no member named 'compressionAlgorithm'
     ba = (res.compressionAlgorithm() != QResource::NoCompression ? qUncompress(res.data(), size) : QByteArray(reinterpret_cast<const char*>(res.data()), size));
               ^~~~~~~~~~~~~~~~~~~~
mainwindow.cpp:400:52: error: 'NoCompression' is not a member of 'QResource'
     ba = (res.compressionAlgorithm() != QResource::NoCompression ? qUncompress(res.data(), size) : QByteArray(reinterpret_cast<const char*>(res.data()), size));
                                                    ^~~~~~~~~~~~~
make: *** [Makefile:292: mainwindow.o] Error 1
radiomanV commented 3 years ago

Yeah, this is a regression. NoCompression doesn't exist in QT4. I have updated my code for this. Please do a git pull and try again. Thanks.

jbrunk1966 commented 3 years ago

Yeah, this is a regression. NoCompression doesn't exist in QT4. I have updated my code for this. Please do a git pull and try again. Thanks.

Almost there ... :)

brunk@pi400:~/tmp/TL866/TL866_Updater/QT $ LC_ALL=C make
/usr/lib/arm-linux-gnueabihf/qt4/bin/uic mainwindow.ui -o ui_mainwindow.h
/usr/lib/arm-linux-gnueabihf/qt4/bin/uic editdialog.ui -o ui_editdialog.h
/usr/lib/arm-linux-gnueabihf/qt4/bin/uic advdialog.ui -o ui_advdialog.h
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o main.o main.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o mainwindow.o mainwindow.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o advdialog.o advdialog.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o firmware.o firmware.cpp
firmware.cpp:29:10: fatal error: QRandomGenerator: No such file or directory
 #include <QRandomGenerator>
          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:309: firmware.o] Error 1

guess "QRandomGenerator" also is only available in QT5?

radiomanV commented 3 years ago

Yes, the QT4 was marked obsolete in Qt 5.xx and i had to update my code to compile clean in QT5. I don't have the QT4 installed anymore. Please allow me to insert some conditionals for QT4.
Also is there any good reason to use QT4? any exotic DE requires this?
The code was updated here: https://github.com/radiomanV/TL866/commit/5904aafcb5d15184108ef624097316affdce6c4a

jbrunk1966 commented 3 years ago

Yes, the QT4 was marked obsolete in Qt 5.xx and i had to update my code to compile clean in QT5. I don't have the QT4 installed anymore. Please allow me to insert some conditionals for QT4. Also is there any good reason to use QT4? any exotic DE requires this? The code was updated here: 5904aaf

i'm running XFCE4 and this doesn't require any QT stuff at all. Seems somehow "old" QT4 stuff landed on my System and the search path of "qt4/bin/qmake" did the rest

#############################################################################
# Makefile for building: TL866_Updater
# Generated by qmake (2.01a) (Qt 4.8.7) on: Mo. Nov 9 15:36:42 2020
# Project:  TL866_Updater.pro
# Template: app
# Command: /usr/lib/arm-linux-gnueabihf/qt4/bin/qmake -o Makefile TL866_Updater.pro
#############################################################################
jbrunk1966 commented 3 years ago

ah okay - cause it's in your GIT Dokumentation :) https://github.com/radiomanV/TL866#install-build-dependencies => libqt4-dev

Sadly currently there's no libqt5-dev for Debian 10/11 ???

radiomanV commented 3 years ago

Yeah, that's old. I should update the readme. I'm using Debian Buster on some of my servers but don't know about libqt5-dev stuff. Perhaps it's in nonfree repo?. Please wait i'll update my TL866 updater to compile in QT4 and i will need some feedback about this. I don't have the QT4 installed here and i write blind unchecked code.

jbrunk1966 commented 3 years ago

Yeah, that's old. I should update the readme. I'm using Debian Buster on some of my servers but don't know about libqt5-dev stuff. Perhaps it's in nonfree repo?. Please wait i'll update my TL866 updater to compile in QT4 and i will need some feedback about this. I don't have the QT4 installed here an i write blind unchecked code.

yep thanks for that, will continue to go with QT4 and will test your stuff ...

radiomanV commented 3 years ago

Added some conditionals for QT4. Please do a pull an check again. Thanks.

jbrunk1966 commented 3 years ago

Added some conditionals for QT4. Please do a pull an check again. Thanks.

brunk@pi400:~/tmp/TL866/TL866_Updater/QT $ make
/usr/lib/arm-linux-gnueabihf/qt4/bin/uic mainwindow.ui -o ui_mainwindow.h
/usr/lib/arm-linux-gnueabihf/qt4/bin/uic editdialog.ui -o ui_editdialog.h
/usr/lib/arm-linux-gnueabihf/qt4/bin/uic advdialog.ui -o ui_advdialog.h
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o main.o main.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o mainwindow.o mainwindow.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o advdialog.o advdialog.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o firmware.o firmware.cpp
firmware.cpp: In constructor ‘Firmware::Firmware()’:
firmware.cpp:75:23: error: incomplete type ‘QDateTime’ used in nested name specifier
     qsrand(QDateTime::currentDateTime().toTime_t());
                       ^~~~~~~~~~~~~~~
make: *** [Makefile:309: firmware.o] Fehler 1
radiomanV commented 3 years ago

There are some changes between QT versions. The compressionAlgorithm is not available for QT < 5.13. Also Qt::endl was introduced in 5.14. I have added more conditionals for this. Annoying as you said. Please pull and try again.

jbrunk1966 commented 3 years ago

There are some changes between QT versions. The compressionAlgorithm is not available for QT < 5.13. Also Qt::endl was introduced in 5.14. I have added more conditionals for this. Annoying as you said. Please pull and try again.

thanks this compiles and works as a chame! thank a lot. btw. were can i d/l the latest Firmware of the TL866A pls? My current FW Version - according to your Updater, and minipro CLI tools - is 3.2.86 ...

radiomanV commented 3 years ago

In the meantime i have ssh-ed on one of my Debian 10 server and did more tests. For QT5 you should install qt5-default and qtbase5-dev packages. Then before qmake && make issue export QT_SELECT=qt5 or export QT_SELECT=qt4 depending on what QT version do you want to compile.

Regarding to the latest firmware version the 3.2.86 is the latest for TL866A. Don't know what version of minipro CLI are you running but i have implemented the firmware update feature for both TL866A/CS and TL866II+ for quite some time. I suppose that you're using this one? https://gitlab.com/DavidGriffith/minipro Also check this: https://gitlab.com/DavidGriffith/minipro/-/issues/185 and this: https://gitlab.com/DavidGriffith/minipro/-/issues/148 I have answered there for some issues.
Thanks for the feedback.