Runtime link problem
2012-02-04 00:58:11 GMT
Hello
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.
Error message:
Command: ./shell: symbol lookup error: ./shell: undefined symbol: SERIAL_GetDtr
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.
Have any idea?
Thanks for you help!
Maya
_______________________________________________ Bug-ncurses mailing list Bug-ncurses <at> gnu.org https://lists.gnu.org/mailman/listinfo/bug-ncurses
>> [SNIP]
>> 20120107
>> + various improvments for MinGW (patch by Juergen Pfeifer):
>> + modify stat() calls to ignore the st_size member
>> + drop mk-dlls.sh script.
>> + change recommended regular expression library.
>> + modify rain.c to allow for threaded configuraton.
>> + modify tset.c to allow for case when size-change logic is not used.
> Thanks to Juergen Pfeifer for mingw patches. It seems to me such patches
> cover native build.
>
> In same topic but not related only to mingw I would like to inform you
> about cross-compilation issue - build on linux form mingw host and run
> in emulated environment.
>
>
> - term_entry.h (real cross-issue)
I've fixed this in tonight's patch (and since I keep overlooking cross
compiles) added a check for cross-compiles to my regression builds.
Since I've more than one VM setup with mingw cross-compilers, I've
also a to-do to investigate building the dll's there. (On my Windows 7,
there's work needed to incorporate Juergen's changes there - just a lot
of things to work through...).
> term_entry.h include term.h and latest is for host system
> make_hash - a binary for build system include term_entry.h to get
> enumerate DBDIRS for some functions in tic.h and cross-build fall if is
> for incompatible host like build from linux to mingw.
> For protocol I enclose all except enumerate in #ifndef USE_BUILD_CC
> to build ncurses.
>
> - db_iterator.c
> mingw patch just ignore st_size member in two places .
> If I understand code check_existence(...) is only to test existence of
> a directory .
> S_ISDIR(sb->st_mode) work on mingw.
> Could "..sb->st_size" be replaced by .._ISDIR(sb->st_mode) ?
I addressed this shortly after your email, since I ran into the same
issue testing with eCS.
RSS Feed