I guess you may need additional library, can you try -lncurses -ltinfo
.
You can check on your system what the linker library flags for ncurses
using command
pkg-config --static --libs ncurses
on my system, I got
-lncurses -ltinfo
Question
I am working on a program which uses ncurses which will be used on embedded systems. Since these systems won't have ncurses installed I need to statically link the library. However if I try to build it like this
gcc -static ncurs.c -o ncurs -l:libncurses.a
or
gcc -static ncurs.c -o ncurs -lncurses
I get a ton of errors like this:
(.text+0x48): undefined reference to `SP'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libncurses.a(lib_slktouch.o): In function `slk_touch':
normal compilation works fine.
I have searched for hours but I can't find any good information...
platform of development is stripped down debian system.
Solution
I guess you may need additional library, can you try -lncurses -ltinfo
.
You can check on your system what the linker library flags for ncurses
using command
pkg-config --static --libs ncurses
on my system, I got
-lncurses -ltinfo
OTHER TIPS
try adding -ltinfo
to the end of your commandline