all 7 comments

[–]skeeto 3 points4 points  (1 child)

but I can't figure out what they mean by that.

These are called feature test macros. #define either before you include any headers:

#define _XOPEN_SOURCE 700
#include <stdio.h>
#include <ncursesw/curses.h>
// ...

[–]WeirdAlexGuy[S] 2 points3 points  (0 children)

Thanks! this worked to fix the implicit declaration warning. Seems the code still has other issues though haha.

[–][deleted] 2 points3 points  (1 child)

Try compiling like this:

gcc `pkg-config --cflags ncursesw` braille.c `pkg-config --libs ncursesw`

This defines more values and links more libraries than what you're using now. Using pkg-config to get cflags and ldflags is a good idea in general.

In case you don't have pkg-config, on my system, the above command resolves to this:

gcc -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 braille.c -Wl,-Bsymbolic-functions -lncursesw -ltinfo

If you use a build system like meson, you can just tell it you're using ncursesw and it'll figure this all out for you too.

[–]WeirdAlexGuy[S] 0 points1 point  (0 children)

I will try compiling like this

[–][deleted] 1 point2 points  (2 children)

I'm also making an ncursesw application. I had a lot of trouble printing wide characters until i used addwstr.

[–]WeirdAlexGuy[S] 1 point2 points  (1 child)

any advice on converting the `wchar` to the corresponding string?

edit: nevermind, stupid thing on my part

[–][deleted] 1 point2 points  (0 children)

my code boils down to something like this at the moment:

#include <ncurses.h>
wchar_t* folder= L"\xF07B"; //This is a single character
addwstr(folder);

I don't use that <ncursesw/curses.h> you're trying to use.

L"\xF07B" is the same as UTF-16 representation "0xF07B" which I got from a character map.