Hi,
I tried to use the ncurses library.
using it in a small executable is not a problem.
Now I want to use it within a shared library and it seems to be not so
easy.
There is no problem at link but when I start my application, which use
the shared library linked with ncurses, I get a ‘segmentation violation’
before entering in main().
how can I do in order my shared library uses ncurses functions?
Thanks,
Alain.
Alain Bonnefoy <alain.bonnefoy@icbt.com> wrote:
Hi,
I tried to use the ncurses library.
using it in a small executable is not a problem.
Now I want to use it within a shared library and it seems to be not so
easy.
There is no problem at link but when I start my application, which use
the shared library linked with ncurses, I get a ‘segmentation violation’
before entering in main().
how can I do in order my shared library uses ncurses functions?
Get libncurses.so from http://staff.qnx.com/~cburgess/libncurses.tgz
-xtang
“Xiaodan Tang” <xtang@qnx.com> wrote in message
news:9bk87t$2na$3@nntp.qnx.com…
Alain Bonnefoy <> alain.bonnefoy@icbt.com> > wrote:
Hi,
I tried to use the ncurses library.
using it in a small executable is not a problem.
Now I want to use it within a shared library and it seems to be not so
easy.
There is no problem at link but when I start my application, which use
the shared library linked with ncurses, I get a ‘segmentation violation’
before entering in main().
how can I do in order my shared library uses ncurses functions?
Get libncurses.so from > http://staff.qnx.com/~cburgess/libncurses.tgz
…because if a shared library uses the functions of another library, this
other library must be shared as well.
the problem is that the linker does not complain, it just takes libncurses.a
(static) and then crashes at execution.
No way that the linker could detect this and come back with an error
message???
Markus
Xiaodan Tang a écrit :
Alain Bonnefoy <> alain.bonnefoy@icbt.com> > wrote:
Hi,
I tried to use the ncurses library.
using it in a small executable is not a problem.
Now I want to use it within a shared library and it seems to be not so
easy.
There is no problem at link but when I start my application, which use
the shared library linked with ncurses, I get a ‘segmentation violation’
before entering in main().
how can I do in order my shared library uses ncurses functions?
Get libncurses.so from > http://staff.qnx.com/~cburgess/libncurses.tgz
-xtang
I got it, but now in /usr/lib/ I have lbncurses.a and libncurses.so.
My project uses the recursive makefiles.
How can I be sure that the linker takes lbncurses.so.
Do I have to put something special in common.mk?
Thanks,
Alain.
If you don’t specify “-Bdynamic” or “-Bstatic” in the linker line, the
linker uses the *.so by default.
If you see a “-Bstatic” somewhere before your “-lncurses”, you should change
it to “-Bdynamic”
Markus
“Alain Bonnefoy” <alain.bonnefoy@icbt.com> wrote in message
news:3ADEA1FE.DA7A2608@icbt.com…
Xiaodan Tang a écrit :
Alain Bonnefoy <> alain.bonnefoy@icbt.com> > wrote:
Hi,
I tried to use the ncurses library.
using it in a small executable is not a problem.
Now I want to use it within a shared library and it seems to be not so
easy.
There is no problem at link but when I start my application, which use
the shared library linked with ncurses, I get a ‘segmentation
violation’
before entering in main().
how can I do in order my shared library uses ncurses functions?
Get libncurses.so from > http://staff.qnx.com/~cburgess/libncurses.tgz
-xtang
I got it, but now in /usr/lib/ I have lbncurses.a and libncurses.so.
My project uses the recursive makefiles.
How can I be sure that the linker takes lbncurses.so.
Do I have to put something special in common.mk?
Thanks,
Alain.