#include <ncursesw/ncurses.h>
#include <locale.h> // setlocale()
#include <unistd.h> // sleep()
#include <wchar.h>
int main() {
const char *s = "Привет";
const wchar_t *sw = L"Привет";
WINDOW *window;
setlocale(LC_ALL,"ru_RU.UTF-8");
window = initscr();
wprintw(window,s);
waddwstr(window,sw);
wrefresh(window);
sleep(1);
endwin();
return 0;
}
NAME=test
${NAME} : ${NAME}.c
gcc -Wall -finput-charset=utf-8 -o ${NAME} ${NAME}.c -lncursesw
$ make
gcc -Wall -finput-charset=utf-8 -o test test.c -lncursesw
test.c: In function ‘main’:
test.c:14: warning: implicit declaration of function ‘waddwstr’
Почему возникает такое сообщение (warning)? Вроде функция объявлена:
$ grep -re waddwstr /usr/include/
/usr/include/ncursesw/ncurses.h:extern NCURSES_EXPORT(int) mvwaddwstr (WINDOW *, int, int, const wchar_t *); /* generated:WIDEC */
/usr/include/ncursesw/ncurses.h:extern NCURSES_EXPORT(int) waddwstr (WINDOW *,const wchar_t *); /* generated:WIDEC */
/usr/include/ncursesw/ncurses.h:#define addwstr(wstr) waddwstr(stdscr,wstr)
/usr/include/ncursesw/ncurses.h:#define waddwstr(win,wstr) waddnwstr(win,wstr,-1)
/usr/include/ncursesw/ncurses.h:#define mvaddwstr(y,x,wstr) mvwaddwstr(stdscr,y,x,wstr)
/usr/include/ncursesw/ncurses.h:#define mvwaddwstr(win,y,x,wstr) (wmove(win,y,x) == ERR ? ERR : waddwstr(win,wstr))
/usr/include/ncursesw/curses.h:extern NCURSES_EXPORT(int) mvwaddwstr (WINDOW *, int, int, const wchar_t *); /* generated:WIDEC */
/usr/include/ncursesw/curses.h:extern NCURSES_EXPORT(int) waddwstr (WINDOW *,const wchar_t *); /* generated:WIDEC */
/usr/include/ncursesw/curses.h:#define addwstr(wstr) waddwstr(stdscr,wstr)
/usr/include/ncursesw/curses.h:#define waddwstr(win,wstr) waddnwstr(win,wstr,-1)
/usr/include/ncursesw/curses.h:#define mvaddwstr(y,x,wstr) mvwaddwstr(stdscr,y,x,wstr)
/usr/include/ncursesw/curses.h:#define mvwaddwstr(win,y,x,wstr) (wmove(win,y,x) == ERR ? ERR : waddwstr(win,wstr))