Tiny Core Linux
Off-Topic => Off-Topic - Tiny Core Lounge => Topic started by: asi3brg on January 29, 2020, 07:04:04 AM
-
I'm testing run in a tool the O.S. TinyCore were we execute a main SW that call a new shared object, LibCAN.so, to comunicate in a CAN BUS, but when we call this LibCAN.so we have a Segmentation fault, see img attached(running with GDB for more details).
We have a warning during compilation of this LibCAN.so, see img attached.
NOTE: Using this LibCAN.so in Ubuntu everything works as expected.
Some idea or hint?
-
Hi asi3brg
The SIGSEGV error shows an attempt to use address 0x00000000 which is not valid. I think you are going to have to install gdb.tcz
to trace that error.
-
I' trying to compile in Tiny Core the main SW (that calls the shared object) and I' getting errors (ncurses is installed):
/mnt/sdb2/BBoxTeste/BlBox_SW/CAN.c:6418: undefined reference to `stdscr'
/usr/local/bin/ld: /mnt/sdb2/BBoxTeste/BlBox_SW/CAN.c:6418: undefined reference to `wprintw'
/usr/local/bin/ld: /mnt/sdb2/BBoxTeste/BlBox_SW/CAN.c:6418: undefined reference to `stdscr'
/usr/local/bin/ld: /mnt/sdb2/BBoxTeste/BlBox_SW/CAN.c:6418: undefined reference to `wrefresh'
/usr/local/bin/ld: /tmp/ccsjBzuw.o: in function `UpdateCANDisplayLine':
/mnt/sdb2/BBoxTeste/BlBox_SW/CAN.c:7598: undefined reference to `stdscr'
/usr/local/bin/ld: /mnt/sdb2/BBoxTeste/BlBox_SW/CAN.c:7602: undefined reference to `wmove'
/usr/local/bin/ld: /mnt/sdb2/BBoxTeste/BlBox_SW/CAN.c:7602: undefined reference to `stdscr'
/usr/local/bin/ld: /mnt/sdb2/BBoxTeste/BlBox_SW/CAN.c:7602: undefined reference to `wrefresh'
/usr/local/bin/ld: /mnt/sdb2/BBoxTeste/BlBox_SW/CAN.c:7603: undefined reference to `stdscr'
/usr/local/bin/ld: /mnt/sdb2/BBoxTeste/BlBox_SW/CAN.c:7603: undefined reference to `wprintw'
/usr/local/bin/ld: /mnt/sdb2/BBoxTeste/BlBox_SW/CAN.c:7603: undefined reference to `stdscr'
/usr/local/bin/ld: /mnt/sdb2/BBoxTeste/BlBox_SW/CAN.c:7603: undefined reference to `wrefresh'
/usr/local/bin/ld: /mnt/sdb2/BBoxTeste/BlBox_SW/CAN.c:7607: undefined reference to `stdscr'
/usr/local/bin/ld: /mnt/sdb2/BBoxTeste/BlBox_SW/CAN.c:7607: undefined reference to `wmove'
/usr/local/bin/ld: /mnt/sdb2/BBoxTeste/BlBox_SW/CAN.c:7607: undefined reference to `stdscr'
/usr/local/bin/ld: /mnt/sdb2/BBoxTeste/BlBox_SW/CAN.c:7607: undefined reference to `wrefresh'
/usr/local/bin/ld: /mnt/sdb2/BBoxTeste/BlBox_SW/CAN.c:7608: undefined reference to `stdscr'
/usr/local/bin/ld: /mnt/sdb2/BBoxTeste/BlBox_SW/CAN.c:7608: undefined reference to `wprintw'
/usr/local/bin/ld: /mnt/sdb2/BBoxTeste/BlBox_SW/CAN.c:7608: undefined reference to `stdscr'
/usr/local/bin/ld: /mnt/sdb2/BBoxTeste/BlBox_SW/CAN.c:7608: undefined reference to `wrefresh'
/usr/local/bin/ld: /mnt/sdb2/BBoxTeste/BlBox_SW/CAN.c:7610: undefined reference to `stdscr'
/usr/local/bin/ld: /mnt/sdb2/BBoxTeste/BlBox_SW/CAN.c:7610: undefined reference to `wmove'
/usr/local/bin/ld: /mnt/sdb2/BBoxTeste/BlBox_SW/CAN.c:7610: undefined reference to `stdscr'
/usr/local/bin/ld: /mnt/sdb2/BBoxTeste/BlBox_SW/CAN.c:7610: undefined reference to `wrefresh'
/usr/local/bin/ld: /tmp/ccsjBzuw.o: in function `CanConfigureID':
/mnt/sdb2/BBoxTeste/BlBox_SW/CAN.c:780: undefined reference to `stdscr'
/usr/local/bin/ld: /mnt/sdb2/BBoxTeste/BlBox_SW/CAN.c:780: undefined reference to `wprintw'
[EDIT]: Added code tags. Rich
-
Hi, asi3brg!
If You want to compile some software You need to install corresponding *-dev extensions. For example to use libncurses* install ncurses-dev.
-
It was already installed.
-
Seem that You will need to take a closer look on the sources, including the make files. Try to compare, where include files are expected to be located, and their actual location.
And I see function wprintfw, which is wide-char version of wprintf, so You need ncursesw instead of ncurses.
-
Hi asi3brg
You should have ncursesw-dev.tcz (NOT ncurses-dev.tcz) installed. The headers are under /usr/local/include/ncursesw/ so your
source file needs something like:
#include <ncursesw/ncurses.h>
-
I apologize for the late feedback, however, although it is a basic error, it can always help any beginner in a setup of this type where a shared library is called by a sw main. The problem was related to the permissions of this shared library, solved with the command chmod 755.