You are not logged in.
Hi,
I have several ncurses programs that not compile after the update 6.0+20170902-2.
Before update, everything was fine.
Here an example code :
#include <ncurses.h>
#include <curses.h>
int main(void)
{
initscr();
keypad(stdscr, TRUE);
endwin();
return (0);
}
Generate obj file :
gcc -c foo.c
Compile :
gcc -o foo foo.o -lncurses
Error :
/usr/bin/ld: foo.o: undefined reference to symbol 'keypad'
/usr/lib/libtinfo.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Several ncurses functions generate symbols errors like in the example.
What's wrong ?
Offline
and if you add -ltinfo as well?
You really shouldn't be hard-coding these things anyway. That's what pkg-config is for.
Last edited by Scimmia (2017-10-24 23:52:12)
Online
Ok that works with -ltinfo
But i think it is not normal of link that lib for compile ncurses programms. Thanks Scimmia.
Last edited by qlem (2017-10-25 12:56:03)
Offline
It definitely is normal; again, see pkg-config
Online
Ok that works with -ltinfo
But i think it is not normal of link that lib for compile ncurses programms. Thanks Scimmia.
What isn't normal, is adding -lfoo by hand instead of using pkg-config. That being said, the ncurses maintainer has apparently decided to pander to this usecase and the usecase of a variety of terrible upstreams, by modifying /usr/lib/libncursesw.so to automatically link tinfo at the same time.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline