Titor8115 / mandown

man-page inspired Markdown viewer
GNU General Public License v3.0
246 stars 13 forks source link

Change ncurses.h includes to be able to build on arch linux #7

Closed jfaltis closed 4 years ago

jfaltis commented 4 years ago

When trying to build the project on arch linux this error occured:

gcc -c -g -O3 -fPIC -Wall -Wsign-compare -Iparser -Iblender -Iinclude -I/usr/include/libxml2 -c -o src/mandown.o src/mandown.c In file included from src/mandown.c:12: include/view.h:3:10: fatal error: ncursesw/ncurses.h: No such file or directory 3 | #include <ncursesw/ncurses.h> | ^~~~~~~~~~~~~~~~~~~~ compilation terminated. make: *** [<builtin>: src/mandown.o] Error 1

Replacing #include <ncursesw/ncurses.h> with #include <ncurses.h> fixed this problem. I dont know whether this breaks the build process on other systems. I successfully built with these changes on Raspbian.

Titor8115 commented 4 years ago

Changing the header will not break the build process. I was considering the potential supports of wide characters when first writing the headers. On that note, Would you mind send me a copy of your absolute path to libncurses on your device? I'm rewriting the Makefile and some code for the preprocessor so that it could be compiled in different systems

Titor8115 commented 4 years ago

When trying to build the project on arch linux this error occured:

gcc -c -g -O3 -fPIC -Wall -Wsign-compare -Iparser -Iblender -Iinclude -I/usr/include/libxml2 -c -o src/mandown.o src/mandown.c In file included from src/mandown.c:12: include/view.h:3:10: fatal error: ncursesw/ncurses.h: No such file or directory 3 | #include <ncursesw/ncurses.h> | ^~~~~~~~~~~~~~~~~~~~ compilation terminated. make: *** [<builtin>: src/mandown.o] Error 1

Replacing #include <ncursesw/ncurses.h> with #include <ncurses.h> fixed this problem. I dont know whether this breaks the build process on other systems. I successfully built with these changes on Raspbian.

I just add preprocessor stuff to optionally include <ncursesw/ncurses.h> or <ncurses.h>. It should do the trick.

jfaltis commented 4 years ago

The preprocessor changes work for me. The header file is located /usr/include/ncurses.h on my device. The libncurses libraries are at /usr/lib32/libncurses.so and /usr/lib/libncurses.so.

Titor8115 commented 4 years ago

Nice!