I'm new to ncurses. Read doc and FAQ but not found the solution to my problem.
I'm creating a .so library: ok. Writing a test application that links to my library and calls its functions: ok.
But to perform deeper tests, in my case, a human interaction would be better (using serial port IO pins and minimal hw instrumentation). So I found ncurses that would be great for user controlled tests, in a terminal window.
I learned about basic functions such as initscr(), keypad() and printw().
When I compile and run, it works fine for these functions.
But mycode crashes at run time when I call a function of my libray, without any warning/error at link time and I can't figure why.
My library is correctly (I think so) linked, but when behaviour changes when I link with ncurses.
This function is in my lib, that I created and compiled. And it works successfully when not using ncurses.
Test program Makefile: gcc -Wall xx1.o xx2.o -o shell -L../../module_src/src/ -l first_lib -l pthread -l ncurses
(this links with no warning, and runs if I remove -l ncurses and ncurses calls).
Compiled on Ubuntu 10.04 with 2.6.32-38-generic kernel (x86).
Function prototype: bool SERIAL_GetDtr(int fd); bool is typedef enum {false = FALSE, true = TRUE} bool;
I seems that there is a link problem, visible only at runtime, as soon as I link with ncursed. But can't figure why. Not absolutely sure it's ncurses related, but ncurses link triggers it.