ChibiOS shell, STM32 and C++, linking problem

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: barthess, RoccoMarco, utzig, lbednarz, tfAteba

nameless1379
Posts: 1
Joined: Sun Mar 25, 2018 4:30 am

ChibiOS shell, STM32 and C++, linking problem

Postby nameless1379 » Sun Mar 25, 2018 4:44 am

Dear Giovanni:

I have recently started to use the C++ features of ChibiOS/RT 16.1.9. It works well before I tried to create a shell, and shows some errors on GCC linking as shown below.

Linking build/ch.elf
/usr/lib/gcc/arm-none-eabi/4.9.3/../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-abort.o): In function `abort':
/build/newlib-5zwpxE/newlib-2.2.0+git20150830.5a3d536/build/arm-none-eabi/armv7e-m/fpu/newlib/libc/stdlib/../../../../../../../newlib/libc/stdlib/abort.c:63: undefined reference to `_exit'
/usr/lib/gcc/arm-none-eabi/4.9.3/../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-signalr.o): In function `_kill_r':
/build/newlib-5zwpxE/newlib-2.2.0+git20150830.5a3d536/build/arm-none-eabi/armv7e-m/fpu/newlib/libc/reent/../../../../../../../newlib/libc/reent/signalr.c:61: undefined reference to `_kill'
/usr/lib/gcc/arm-none-eabi/4.9.3/../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-signalr.o): In function `_getpid_r':
/build/newlib-5zwpxE/newlib-2.2.0+git20150830.5a3d536/build/arm-none-eabi/armv7e-m/fpu/newlib/libc/reent/../../../../../../../newlib/libc/reent/signalr.c:97: undefined reference to `_getpid'
collect2: ERROR: ld returned 1 exit status

This problem only occurs when I invoke a "shellCreateStatic" function, and I really cannot solve this by myself. I also included the C++ wrapper which contains these undefined functions in my Makefile, but the result is the same. I am looking forward to your reply.

User avatar
Giovanni
Site Admin
Posts: 11025
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 354 times
Been thanked: 298 times
Contact:

Re: ChibiOS shell, STM32 and C++, linking problem

Postby Giovanni » Sun Mar 25, 2018 8:16 am

Hi,

You need to include /os/various/syscalls.c

Moved in a support forum.

Giovani


Return to “General Support”

Who is online

Users browsing this forum: No registered users and 1 guest