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.
ChibiOS shell, STM32 and C++, linking problem
Moderators: RoccoMarco, lbednarz, utzig, tfAteba, barthess
-
- Posts: 1
- Joined: Sun Mar 25, 2018 4:30 am
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: ChibiOS shell, STM32 and C++, linking problem
Hi,
You need to include /os/various/syscalls.c
Moved in a support forum.
Giovani
You need to include /os/various/syscalls.c
Moved in a support forum.
Giovani
Who is online
Users browsing this forum: No registered users and 15 guests