undefined references to '__libc_do_syscall' while compile for A20

Started by Alessio, March 16, 2022, 04:56:44 PM

Previous topic - Next topic

Alessio

Hello,
I'm trying to compile a c++ project using the A20-SOM204-EVB. The project use some library like mqueue, sqlite3 and jsoncpp. For develop the project I use vs code. For compiling the project I use g++ located in the path /usr/bin/g++.
For compiling I use the following istruction:
 
usr/bin/g++ -g /home/olimex/Desktop/crypto_deamon_v0.1/main.cpp /home/olimex/Desktop/crypto_deamon_v0.1/my_mqueue/my_mqueue.c /home/olimex/Desktop/crypto_deamon_v0.1/uart_pi/uart_pi.c /home/olimex/Desktop/crypto_deamon_v0.1/spc_database/fun_db.c /home/olimex/Desktop/crypto_deamon_v0.1/json/jFiles.cpp /home/olimex/Desktop/crypto_deamon_v0.1/task/commCtrlBoard_task.cpp /home/olimex/Desktop/crypto_deamon_v0.1/task/commApp_task.cpp /home/olimex/Desktop/crypto_deamon_v0.1/task/payment_task.cpp /home/olimex/Desktop/crypto_deamon_v0.1/task/billsReader_task.cpp /home/olimex/Desktop/crypto_deamon_v0.1/task/main_task.cpp /home/olimex/Desktop/crypto_deamon_v0.1/task/cardBarcode_task.cpp -lsqlite3 -lrt -ljsoncpp -I/home/olimex/Desktop/crypto_deamon_v0.1/uart_pi -I/home/olimex/Desktop/crypto_deamon_v0.1/my_mqueue -I/home/olimex/Desktop/crypto_deamon_v0.1/task -I/home/olimex/Desktop/crypto_deamon_v0.1/spc_database -I/home/olimex/Desktop/crypto_deamon_v0.1/json -I/home/olimex/Desktop/crypto_deamon_v0.1/utilities -o /home/olimex/Desktop/crypto_deamon_v0.1/main

But it's return to me the following error:

/usr/bin/ld: /usr/lib/gcc/arm-linux-gnueabihf/10/../../../arm-linux-gnueabihf/librt.a(mq_open.o): in function `__mq_open':
(.text+0x38): undefined reference to `__libc_do_syscall'
/usr/bin/ld: /usr/lib/gcc/arm-linux-gnueabihf/10/../../../arm-linux-gnueabihf/librt.a(mq_close.o): in function `mq_close':
(.text+0x6): undefined reference to `__libc_do_syscall'
/usr/bin/ld: /usr/lib/gcc/arm-linux-gnueabihf/10/../../../arm-linux-gnueabihf/librt.a(mq_unlink.o): in function `mq_unlink':
(.text+0xe): undefined reference to `__libc_do_syscall'
/usr/bin/ld: /usr/lib/gcc/arm-linux-gnueabihf/10/../../../arm-linux-gnueabihf/librt.a(mq_timedsend.o): in function `__mq_timedsend':
(.text+0x16): undefined reference to `__libc_do_syscall'
/usr/bin/ld: (.text+0x44): undefined reference to `__libc_do_syscall'
/usr/bin/ld: /usr/lib/gcc/arm-linux-gnueabihf/10/../../../arm-linux-gnueabihf/librt.a(mq_timedreceive.o):(.text+0x16): more undefined references to `__libc_do_syscall' follow
collect2: error: ld returned 1 exit status


Why I have this error? How can I resolve it?

Thanks for the reply