visit1985/mdp

Required dependencies issue - SOLVED

micrub opened this issue · 1 comments

While making after checkout on Ubuntu 14.04:

mdp master 150d ➜ make
make  -C src
make[1]: Entering directory `/home/michaelr/projects/github/mdp/src'
cc -O3 -Wall -I../include -I/usr/include/ncursesw  -c -o cstack.o cstack.c
cc -O3 -Wall -I../include -I/usr/include/ncursesw  -c -o cstring.o cstring.c
cc -O3 -Wall -I../include -I/usr/include/ncursesw  -c -o main.o main.c
cc -O3 -Wall -I../include -I/usr/include/ncursesw  -c -o markdown.o markdown.c
cc -O3 -Wall -I../include -I/usr/include/ncursesw  -c -o parser.o parser.c
cc -O3 -Wall -I../include -I/usr/include/ncursesw  -c -o url.o url.c
cc -O3 -Wall -I../include -I/usr/include/ncursesw  -c -o viewer.o viewer.c
viewer.c: In function ‘ncurses_display’:
viewer.c:294:13: warning: implicit declaration of function ‘mvwaddwstr’ [-Wimplicit-function-declaration]
             mvwaddwstr(stdscr,
             ^
viewer.c:363:17: warning: implicit declaration of function ‘waddwstr’ [-Wimplicit-function-declaration]
                 waddwstr(content, url_get_target(i));
                 ^
viewer.c: In function ‘inline_display’:
viewer.c:769:25: warning: implicit declaration of function ‘waddnwstr’ [-Wimplicit-function-declaration]
                         waddnwstr(window, i, 1);
                         ^
make[1]: Leaving directory `/home/michaelr/projects/github/mdp/src'
cc src/cstack.o src/cstring.o src/main.o src/markdown.o src/parser.o src/url.o src/viewer.o -lncursesw -s -o mdp
/usr/bin/ld: cannot find -lncursesw
collect2: error: ld returned 1 exit status
make: *** [mdp] Error 1

Solution:

mdp master 150d ⍉ ➜  sudo apt-get install libncursesw5-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  ncurses-doc
The following NEW packages will be installed:
  libncursesw5-dev
0 upgraded, 1 newly installed, 0 to remove and 27 not upgraded.
Need to get 197 kB of archives.
After this operation, 1,208 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ trusty/main libncursesw5-dev amd64 5.9+20140118-1ubuntu1 [197 kB]
Fetched 197 kB in 0s (447 kB/s)          
Selecting previously unselected package libncursesw5-dev:amd64.
(Reading database ... 1054224 files and directories currently installed.)
Preparing to unpack .../libncursesw5-dev_5.9+20140118-1ubuntu1_amd64.deb ...
Unpacking libncursesw5-dev:amd64 (5.9+20140118-1ubuntu1) ...
Setting up libncursesw5-dev:amd64 (5.9+20140118-1ubuntu1) ...
mdp master 150d ➜ make                                  
make  -C src
make[1]: Entering directory `/home/michaelr/projects/github/mdp/src'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/michaelr/projects/github/mdp/src'
cc src/cstack.o src/cstring.o src/main.o src/markdown.o src/parser.o src/url.o src/viewer.o -lncursesw -s -o mdp
mdp master 150d ➜ make install
install -d /usr/local/bin
install -m 755 mdp /usr/local/bin/mdp
install: cannot create regular file ‘/usr/local/bin/mdp’: Permission denied
make: *** [install] Error 1
mdp master 150d ⍉ ➜ sudo make install
install -d /usr/local/bin
install -m 755 mdp /usr/local/bin/mdp
install -d /usr/local/share/man/man1
install -m 644 mdp.1 /usr/local/share/man/man1/mdp.1
mdp master 150d ⍉ ➜ mdp README.md

On Ubuntu you can install mdp via apt. However, the dependencies are already described in README.md if you want to compile it your own.