bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: Runtime link problem


From: Thomas Dickey
Subject: re: Runtime link problem
Date: Sat, 18 Feb 2012 20:05:22 -0500
User-agent: Mutt/1.5.18 (2008-05-17)

>*From*:        Olivier TARTROU
>*Subject*:     Runtime link problem
>*Date*:        Sat, 4 Feb 2012 01:58:11 +0100
>
>------------------------------------------------------------------------
>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 -lpthread 
>-l ncurses

Perhaps there's a problem with the way you're using threads.
Normally ncurses isn't threadsafe; it's possible to improve that.

>(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?

From the description, it's more than "ncurses link" but the execution
of the program.

-- 
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]