Unable to build utils / smsq on Asterisk 1.8 - asterisk

While building smsq for Asterisk 1.8 the first error I got was missing pots.h. I solved this by installing libpopt-dev sudo apt-get install libpopt-dev. Now I am getting
desktop:~/Development/asterisk/asterisk-1.8.22.0$ sudo make utils/smsq
gcc utils/smsq.c -o utils/smsq
/tmp/cc87NdXn.o: In function `main':
smsq.c:(.text+0x25fe): undefined reference to `poptHelpOptions'
smsq.c:(.text+0x2634): undefined reference to `poptGetContext'
smsq.c:(.text+0x2652): undefined reference to `poptSetOtherOptionHelp'
smsq.c:(.text+0x2661): undefined reference to `poptGetNextOpt'
smsq.c:(.text+0x2682): undefined reference to `poptStrerror'
smsq.c:(.text+0x269b): undefined reference to `poptBadOption'
smsq.c:(.text+0x294b): undefined reference to `poptPeekArg'
smsq.c:(.text+0x295e): undefined reference to `poptGetArg'
smsq.c:(.text+0x298a): undefined reference to `poptPeekArg'
smsq.c:(.text+0x299d): undefined reference to `poptGetArg'
smsq.c:(.text+0x2c9d): undefined reference to `poptPeekArg'
smsq.c:(.text+0x2cb9): undefined reference to `poptGetArg'
smsq.c:(.text+0x2da1): undefined reference to `poptPeekArg'
smsq.c:(.text+0x2dc5): undefined reference to `poptPeekArg'
smsq.c:(.text+0x2dd8): undefined reference to `poptGetArg'
collect2: ld returned 1 exit status
make: *** [utils/smsq] Error 1

I figured it out, the following steps helped.
make clean
./configure --with-bluetooth **note that bluetooth has nothing to do with this issue, I need it for chan_mobile**
sudo make
make menuconfig -> Utilities -> smsq enable it
sudo make install
cd utils **note do not use make utils/smsq, it wont work**
make smsq **its now built**
sudo cp smsq /usr/bin/asterisk/
Basically menuconfig did not have smsq enabled it hat XXX, that indicated a build issue with smsq. I guess common sense triggered that building asterisk will setup the smsq references to popt$$$$ links for ld. And enabling it before the make install also make sense.

Related

libQt5SerialPort.so.5: undefined reference to `udev_device_get_devnode#LIBUDEV_183 when cross-building Qt-everywhere-src-5.13.1 for BeagleBone Black

I am new to using Qt (and building it).
I have searched on the web and landed at multiple ways of cross-building the Qt src for Beaglebone Black, of multiple versions, but haven't been successful to build any of those.
I am following the guide from one of the GitHub pages here.
The configure and make commands worked fine and didn't give any errors (just some warnings).
But when I tried "make install", the build continued until I was bombarded with a bunch of errors for with the 'libQt5SerialPort.so.5' and fails ultimately with 'Error 1' and 'Error 2'.
Here's the terminal log which give the undefined reference errors:
make[4]: Entering directory '/home/yash/BBB/qt-everywhere-src-5.13.1/qtserialbus/src/tools/canbusutil'
/home/yash/BBB/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/home/yash/BBB/sysroot -Wl,-O1 -Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,\$ORIGIN/../lib -Wl,-rpath-link,/home/yash/BBB/qt-everywhere-src-5.13.1/qtbase/lib -Wl,-rpath-link,/home/yash/BBB/qt-everywhere-src-5.13.1/qtserialport/lib -o ../../../bin/canbusutil .obj/main.o .obj/readtask.o .obj/canbusutil.o .obj/sigtermhandler.o .obj/moc_readtask.o .obj/moc_canbusutil.o .obj/moc_sigtermhandler.o /home/yash/BBB/qt-everywhere-src-5.13.1/qtserialbus/lib/libQt5SerialBus.so /home/yash/BBB/qt-everywhere-src-5.13.1/qtbase/lib/libQt5Core.so -lpthread -lrt -lpthread -ldl
/home/yash/BBB/qt-everywhere-src-5.13.1/qtserialport/lib/libQt5SerialPort.so.5: undefined reference to `udev_list_entry_get_next#LIBUDEV_183'
/home/yash/BBB/qt-everywhere-src-5.13.1/qtserialport/lib/libQt5SerialPort.so.5: undefined reference to `udev_new#LIBUDEV_183'
/home/yash/BBB/qt-everywhere-src-5.13.1/qtserialport/lib/libQt5SerialPort.so.5: undefined reference to `udev_device_new_from_syspath#LIBUDEV_183'
/home/yash/BBB/qt-everywhere-src-5.13.1/qtserialport/lib/libQt5SerialPort.so.5: undefined reference to `udev_device_get_parent#LIBUDEV_183'
/home/yash/BBB/qt-everywhere-src-5.13.1/qtserialport/lib/libQt5SerialPort.so.5: undefined reference to `udev_enumerate_new#LIBUDEV_183'
/home/yash/BBB/qt-everywhere-src-5.13.1/qtserialport/lib/libQt5SerialPort.so.5: undefined reference to `udev_device_unref#LIBUDEV_183'
/home/yash/BBB/qt-everywhere-src-5.13.1/qtserialport/lib/libQt5SerialPort.so.5: undefined reference to `udev_enumerate_add_match_subsystem#LIBUDEV_183'
/home/yash/BBB/qt-everywhere-src-5.13.1/qtserialport/lib/libQt5SerialPort.so.5: undefined reference to `udev_enumerate_get_list_entry#LIBUDEV_183'
/home/yash/BBB/qt-everywhere-src-5.13.1/qtserialport/lib/libQt5SerialPort.so.5: undefined reference to `udev_device_get_driver#LIBUDEV_183'
/home/yash/BBB/qt-everywhere-src-5.13.1/qtserialport/lib/libQt5SerialPort.so.5: undefined reference to `udev_device_get_sysname#LIBUDEV_183'
/home/yash/BBB/qt-everywhere-src-5.13.1/qtserialport/lib/libQt5SerialPort.so.5: undefined reference to `udev_unref#LIBUDEV_183'
/home/yash/BBB/qt-everywhere-src-5.13.1/qtserialport/lib/libQt5SerialPort.so.5: undefined reference to `udev_enumerate_scan_devices#LIBUDEV_183'
/home/yash/BBB/qt-everywhere-src-5.13.1/qtserialport/lib/libQt5SerialPort.so.5: undefined reference to `udev_list_entry_get_name#LIBUDEV_183'
/home/yash/BBB/qt-everywhere-src-5.13.1/qtserialport/lib/libQt5SerialPort.so.5: undefined reference to `udev_device_get_property_value#LIBUDEV_183'
/home/yash/BBB/qt-everywhere-src-5.13.1/qtserialport/lib/libQt5SerialPort.so.5: undefined reference to `udev_enumerate_unref#LIBUDEV_183'
/home/yash/BBB/qt-everywhere-src-5.13.1/qtserialport/lib/libQt5SerialPort.so.5: undefined reference to `udev_device_get_devnode#LIBUDEV_183'
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:99: ../../../bin/canbusutil] Error 1
make[4]: Leaving directory '/home/yash/BBB/qt-everywhere-src-5.13.1/qtserialbus/src/tools/canbusutil'
make[3]: *** [Makefile:59: sub-canbusutil-install_subtargets] Error 2
make[3]: Leaving directory '/home/yash/BBB/qt-everywhere-src-5.13.1/qtserialbus/src/tools'
make[2]: *** [Makefile:112: sub-tools-install_subtargets] Error 2
make[2]: Leaving directory '/home/yash/BBB/qt-everywhere-src-5.13.1/qtserialbus/src'
make[1]: *** [Makefile:61: sub-src-install_subtargets] Error 2
make[1]: Leaving directory '/home/yash/BBB/qt-everywhere-src-5.13.1/qtserialbus'
make: *** [Makefile:178: module-qtserialbus-install_subtargets] Error 2
I have tried clean building the same multiple times, but always faced the same issue.
Can someone please help with figuring out what is going wrong here?
Thanks a ton.
I think using an updated image and the qt5 libs. available would be easier for you.
For instance, when you get the image and write it to SD Card from https://forum.beagleboard.org/t/debian-11-x-bullseye-monthly-snapshots/31280 , you can then use this command:
apt search qt5
That will allow you to search for all that is available from qt5 in the Debian Buster or Bullseye Distro(s).
Enjoy. Oh...Bullseye uses apt search while Buster uses apt-cache search.
I have been researching a bit more:
https://doc.qt.io/embedded.html
https://doc.qt.io/QtForMCUs-2.1/qtul-supported-platforms.html#other-target-boards
The idea behind cmake, make, installing on the BBB is far beyond what we can discuss on this forum. I cannot pinpoint the issue from the info. given thus far.
If and when you find time, please visit forum.beagleboard.org and they have many people that are knowledgeable on the BBB on that site.
To anyone trying to build Qt for cross-compilation for BeagleBone Black, following this guide properly would work.
PS: It should be kept in mind to download qtcreator with a version equivalent to or older than the qt-source being built.

An error occurred when the ASAP(Automated Slide Analysis Platform) software was running

With the enthusiastic help of SO netizens, I configured all the environments required for ASAP (Automated Slide Analysis Platform)
The necessary libraries including Boost, Openslide, Qt, etc. have been successfully linked, but the following error occurred
====================[ Build | ASAP | Debug ]====================================
"D:\_Jason\Clion\CLion 2021.2.2\bin\cmake\win\bin\cmake.exe" --build D:\_Jason\C++_hospital\orignal\CLion1.9\ASAP-1.9\cmake-build-debug --target ASAP -- -j 9
[ 25%] Automatic MOC and UIC for target ASAP
[ 25%] Built target ASAP_autogen
[ 50%] Linking CXX executable ASAP.exe
CMakeFiles\ASAP.dir/objects.a(main.cpp.obj): In function `main':
D:/_Jason/C++_hospital/orignal/CLion1.9/ASAP-1.9/ASAP/main.cpp:6: undefined reference to `__imp__ZN12QApplicationC1ERiPPci'
D:/_Jason/C++_hospital/orignal/CLion1.9/ASAP-1.9/ASAP/main.cpp:7: undefined reference to `__imp__ZN4ASAPC1EP7QWidget'
D:/_Jason/C++_hospital/orignal/CLion1.9/ASAP-1.9/ASAP/main.cpp:8: undefined reference to `__imp__ZN7QWidget4showEv'
D:/_Jason/C++_hospital/orignal/CLion1.9/ASAP-1.9/ASAP/main.cpp:10: undefined reference to `__imp__ZN12QApplication4execEv'
D:/_Jason/C++_hospital/orignal/CLion1.9/ASAP-1.9/ASAP/main.cpp:7: undefined reference to `__imp__ZN4ASAPD1Ev'
D:/_Jason/C++_hospital/orignal/CLion1.9/ASAP-1.9/ASAP/main.cpp:6: undefined reference to `__imp__ZN12QApplicationD1Ev'
D:/_Jason/C++_hospital/orignal/CLion1.9/ASAP-1.9/ASAP/main.cpp:7: undefined reference to `__imp__ZN4ASAPD1Ev'
D:/_Jason/C++_hospital/orignal/CLion1.9/ASAP-1.9/ASAP/main.cpp:6: undefined reference to `__imp__ZN12QApplicationD1Ev'
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[3]: *** [CMakeFiles\ASAP.dir\build.make:111: ASAP.exe] Error 1
mingw32-make.exe[2]: *** [CMakeFiles\Makefile2:163: CMakeFiles/ASAP.dir/all] Error 2
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:170: CMakeFiles/ASAP.dir/rule] Error 2
mingw32-make.exe: *** [Makefile:168: ASAP] Error 2
It can be seen from "__imp__ZN12QApplicationD1Ev" that this is a Qt problem. The solution they gave in other forums is to add the statement QT += gui widgets core to the .pro file under this project.However, there is no .pro file in the ASAP source code, so I tried to use the qmake -project command to generate the .pro file. It still doesn't work after adding QT += gui widgets core

Qt's qmqtt comiplation issues on Windows 10

I am trying to develop a simple POC using qmqtt but this module is not available in the Qt lib path. I have the latest Qt version installed, still it's not there.
So, I am trying to compile it under Windows using mingw32 and I get undefined references from the qmqtt's source.
Qt version:5.11.2
Below is the compilation log:
E:\Xavier\qmqtt>mingw32-make
cd src\ && ( if not exist Makefile E:\Xavier\Qt\5.11.2\mingw53_32\bin\qmake.exe -o Makefile E:\Xavier\qmqtt\src\src.pro ) && mingw32-make -f Makefile
mingw32-make[1]: Entering directory 'E:/Xavier/qmqtt/src'
cd mqtt\ && ( if not exist Makefile E:\Xavier\Qt\5.11.2\mingw53_32\bin\qmake.exe -o Makefile E:\Xavier\qmqtt\src\mqtt\mqtt.pro ) && mingw32-make -f Makefile
mingw32-make[2]: Entering directory 'E:/Xavier/qmqtt/src/mqtt'
mingw32-make -f Makefile.Release all
mingw32-make[3]: Entering directory 'E:/Xavier/qmqtt/src/mqtt'
g++ -Wl,-s -shared -Wl,-subsystem,windows -Wl,--out-implib,E:\Xavier\qmqtt\lib\libQt5Mqtt.a -o ..\..\lib\Qt5Mqtt.dll object_script.Qt5Mqtt.Release -LC:\openssl\lib -LC:\Utils\my_sql\mysql-5.6.11-win32\lib -LC:\Utils\postgresql\pgsql\lib -LE:\Xavier\Qt\5.11.2\mingw53_32\lib E:\Xavier\Qt\5.11.2\mingw53_32\lib\libQt5Network.a E:\Xavier\Qt\5.11.2\mingw53_32\lib\libQt5Core.a .obj\release\Qt5Mqtt_resource_res.o
./.obj\release\qmqttclient.o:qmqttclient.cpp:(.text+0x2ba): undefined reference to `__imp__ZeqRK7QStringS1_'
./.obj\release\qmqttclient.o:qmqttclient.cpp:(.text+0x2d8): undefined reference to `__imp__ZN7QStringaSERKS_'
./.obj\release\qmqttclient.o:qmqttclient.cpp:(.text+0x323): undefined reference to `__imp__ZN10QArrayData10deallocateEPS_yy'
./.obj\release\qmqttclient.o:qmqttclient.cpp:(.text+0x38d): undefined reference to `__imp__ZeqRK7QStringS1_'
./.obj\release\qmqttclient.o:qmqttclient.cpp:(.text+0x3a8): undefined reference to `__imp__ZN7QStringaSERKS_'
./.obj\release\qmqttclient.o:qmqttclient.cpp:(.text+0x3f3): undefined reference to `__imp__ZN10QArrayData10deallocateEPS_yy'
./.obj\release\qmqttclient.o:qmqttclient.cpp:(.text+0x4fd): undefined reference to `__imp__ZeqRK7QStringS1_'
./.obj\release\qmqttclient.o:qmqttclient.cpp:(.text+0x518): undefined reference to `__imp__ZN7QStringaSERKS_'
./.obj\release\qmqttclient.o:qmqttclient.cpp:(.text+0x563): undefined reference to `__imp__ZN10QArrayData10deallocateEPS_yy'
./.obj\release\qmqttclient.o:qmqttclient.cpp:(.text+0x59d): undefined reference to `__imp__ZeqRK7QStringS1_'
./.obj\release\qmqttclient.o:qmqttclient.cpp:(.text+0x5b8): undefined reference to `__imp__ZN7QStringaSERKS_'
./.obj\release\qmqttclient.o:qmqttclient.cpp:(.text+0x603): undefined reference to `__imp__ZN10QArrayData10deallocateEPS_yy'
./.obj\release\qmqttclient.o:qmqttclient.cpp:(.text+0x66d): undefined reference to `__imp__ZeqRK7QStringS1_'
./.obj\release\qmqttclient.o:qmqttclient.cpp:(.text+0x688): undefined reference to `__imp__ZN7QStringaSERKS_'
./.obj\release\qmqttclient.o:qmqttclient.cpp:(.text+0x6d3): undefined reference to `__imp__ZN10QArrayData10deallocateEPS_yy'
./.obj\release\qmqttclient.o:qmqttclient.cpp:(.text+0x751): undefined reference to `__imp__ZN10QByteArrayaSERKS_'
./.obj\release\qmqttclient.o:qmqttclient.cpp:(.text+0x7ad): undefined reference to `__imp__ZN10QArrayData10deallocateEPS_yy'
./.obj\release\qmqttclient.o:qmqttclient.cpp:(.text+0x865): undefined reference to `__imp__ZN14QObjectPrivateC2Ei'
./.obj\release\qmqttclient.o:qmqttclient.cpp:(.text+0x86c): undefined reference to `__imp__ZN10QArrayData11shared_nullE'./.obj\release\qmqttclient.o:qmqttclient.cpp:(.text+0x906): undefined reference to `__imp__ZN5QUuid10createUuidEv'
Can anyone help me in getting this resolved?
And I am wondering why by default the library is not available?

QT Creator: undefined reference to 'WinMain#16'

I am building a Unit-Test using this tutorial. However, when compiling my code I get these two errors:
undefined reference to 'WinMain#16'.
collect2: ld returned 1 exit status.
why is this happening?
Did you create a main function where you create a qapplication? There's a good example here
You can also get that error when you're creating a DOS executable instead of a Windows GUI executable. It's looking for winmain() not main(),

How to build Quazip 0.5.1 on Windows 7?

I'm trying to build the quazip libary (version 0.5.1) on Windows 7 (32-bit) with Qt 5.0.1 32-Bit LGPL installed.
When i run in the Qt-Commandprompt:
qmake
mingw32-make
with the directory set to the folder in which I extracted Quazip (C:\Qt\quazip-0.5.1\quazip), I get the following error-log:
C:\Qt\quazip-0.5.1\quazip>mingw32-make
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory 'C:/Qt/quazip-0.5.1/quazip'
g++ -Wl,-s -shared -mthreads -Wl,--out-implib,release\libquazip.a -o release\qua
zip.dll object_script.quazip.Release -LC:\Qt\Qt5\5.0.1\mingw47_32\lib -lQt5Core
./release\unzip.o:unzip.c:(.text+0x1008): undefined reference to `crc32'
./release\unzip.o:unzip.c:(.text+0x10aa): undefined reference to `inflate'
./release\unzip.o:unzip.c:(.text+0x10da): undefined reference to `crc32'
./release\unzip.o:unzip.c:(.text+0x1110): undefined reference to `crc32'
./release\unzip.o:unzip.c:(.text+0x1327): undefined reference to `inflateEnd'
./release\unzip.o:unzip.c:(.text+0x1727): undefined reference to `get_crc_table'
./release\unzip.o:unzip.c:(.text+0x186f): undefined reference to `inflateInit2_'
./release\zip.o:zip.c:(.text+0xac7): undefined reference to `crc32'
./release\zip.o:zip.c:(.text+0xb7c): undefined reference to `deflate'
./release\zip.o:zip.c:(.text+0xcdf): undefined reference to `deflate'
./release\zip.o:zip.c:(.text+0xef5): undefined reference to `deflateEnd'
./release\zip.o:zip.c:(.text+0x13a8): undefined reference to `get_crc_table'
./release\zip.o:zip.c:(.text+0x1af9): undefined reference to `deflateInit2_'
./release\quaadler32.o:quaadler32.cpp:(.text+0x2e): undefined reference to `adle
r32'
./release\quaadler32.o:quaadler32.cpp:(.text+0x61): undefined reference to `adle
r32'
./release\quaadler32.o:quaadler32.cpp:(.text+0xa1): undefined reference to `adle
r32'
./release\quaadler32.o:quaadler32.cpp:(.text+0xb1): undefined reference to `adle
r32'
c:/qt/qt5/tools/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64
-mingw32/bin/ld.exe: ./release\quaadler32.o: bad reloc address 0x0 in section `.
rdata$_ZTI13QuaChecksum32[__ZTI13QuaChecksum32]'
collect2.exe: error: ld returned 1 exit status
Makefile.Release:106: recipe for target 'release\quazip.dll' failed
mingw32-make[1]: *** [release\quazip.dll] Error 1
mingw32-make[1]: Leaving directory 'C:/Qt/quazip-0.5.1/quazip'
makefile:34: recipe for target 'release' failed
mingw32-make: *** [release] Error 2
But in my Zlib-Folder (C:\Qt\Qt5\5.0.1\Src\qtbase\src\3rdparty\zlib) are all this listed files installed.
.
As I tried to solve the problem, I have added into the quazip.pro and into the quazip.pri:
INCLUDEPATH += $$[QT_INSTALL_PREFIX]/src/3rdparty/zlib
, how it is suggested here.
All other solutiuons I have found on Google so far aren't helping.
I hope someone of you can help me.
Greetings,
LVreg
The problem is that QuaZIP can not find the zlib library. You should include the path of the headers an also the libraries when you run qmake:
qmake "INCLUDEPATH+=C:/Qt/Qt5/5.0.1/Src/qtbase/src/3rdparty/zlib" "LIBS+=-LC:/Qt/Qt5/5.0.1/Src/qtbase/src/3rdparty/zlib -lz"
mingw32-make
There is a full explanation in my blog if you want to check it out: http://www.antonioborondo.com/2014/10/22/zipping-and-unzipping-files-with-qt/
Here is what worked for me (QuaZip 0.7 on Windows 7 compiled with MSVC13 32 bits):
In the command line type:
SET INCLUDE=<PathToZib\include>;%INCLUDE%
SET LIB=<PathToZib\lib>;%LIB%
qmake PREFIX=<FolderWhereInstallWillPutFiles> LIBS+=<PathToZib\lib>/zdll.lib
nmake
nmake install
everything between <> must be changed to your applicable path
NOTE:
in the LIBS+= part use / instead of \ as folders delimiter
try to make the lib of quazip on windows - look here:
https://www.maefloresta.com/wiki/doku.php?id=quazip_windows
but - try the following command - instead of "make" take "mingw32-make".

Resources