title: g++ can't find ncurses.h despite it being installed
body: <p>I'm trying to experiment around in ncurses for the first time, but I'm having problems compiling my source code. As far as I can tell, ncurses is installed and in the proper directories.</p>
  
  <p>My makefile is super simple:</p>
  
  <pre><code>.cpp :
      g++ -Wall -g -o $* $*.cpp -std=c++11 -lncurses
  </code></pre>
  
  <p>and here's my output when I try to <code>locate ncurses.h</code></p>
  
  <pre><code>$ locate ncurses.h
  /usr/include/ncursesw/ncurses.h
  </code></pre>
  
  <p>and when I check to see if it's installed</p>
  
  <pre><code>$ dpkg -l | grep ncurses
  ii  libncurses5:amd64                                     5.9+20140118-1ubuntu1                               amd64        shared libraries for terminal handling
  ii  libncursesw5:amd64                                    5.9+20140118-1ubuntu1                               amd64        shared libraries for terminal handling (wide character support)
  ii  libncursesw5-dev:amd64                                5.9+20140118-1ubuntu1                               amd64        developer's libraries for ncursesw
  ii  mtr-tiny                                              0.85-2                                              amd64        Full screen ncurses traceroute tool
  ii  ncurses-base                                          5.9+20140118-1ubuntu1                               all          basic terminal type definitions
  ii  ncurses-bin                                           5.9+20140118-1ubuntu1                               amd64        terminal-related programs and man pages
  ii  ncurses-term                                          5.9+20140118-1ubuntu1                               all          additional terminal type definitions
  </code></pre>
  
  <p>But g++ tells me this when I try to make</p>
  
  <pre><code>bankacct.cpp:18:29: fatal error: ncurses.h: No such file or directory
  compilation terminated.
  </code></pre>
  
  <p>Unfortunately, I've not got root access and I need to be able to compile on this machine. What are my options?</p>
  
  <hr>
  
  <p>I've tried including <code>&lt;ncursesw/ncurses.h&gt;</code> based on suggestions from other users, but now g++ is giving me this error:</p>
  
  <pre><code>$ make bankacct
  g++ -Wall -g -o bankacct bankacct.cpp -std=c++11 -lncurses
  /usr/bin/ld: cannot find -lncurses
  </code></pre>
  
  <p>and if I try removing <code>-lncurses</code> it gives me this:</p>
  
  <pre><code>$ make bankacct
  g++ -Wall -g -o bankacct bankacct.cpp -std=c++11
  /tmp/cc8rPQfK.o: In function `main':
  bankacct.cpp:23: undefined reference to `initscr'
  </code></pre>
  
  <hr>
  
  <p>Now I've tried linking the libraries. Here's what I did:</p>
  
  <pre><code>$ locate libncurse
  /lib/x86_64-linux-gnu/libncurses.so.5
  /lib/x86_64-linux-gnu/libncurses.so.5.9
  /lib/x86_64-linux-gnu/libncursesw.so.5
  /lib/x86_64-linux-gnu/libncursesw.so.5.9
  /usr/lib/x86_64-linux-gnu/libncurses++w.a
  /usr/lib/x86_64-linux-gnu/libncursesw.a
  /usr/lib/x86_64-linux-gnu/libncursesw.so
  /usr/share/doc/libncurses5
  /usr/share/doc/libncursesw5
  /usr/share/doc/libncursesw5-dev
  /var/lib/dpkg/info/libncurses5:amd64.list
  /var/lib/dpkg/info/libncurses5:amd64.md5sums
  /var/lib/dpkg/info/libncurses5:amd64.postinst
  /var/lib/dpkg/info/libncurses5:amd64.postrm
  /var/lib/dpkg/info/libncurses5:amd64.shlibs
  /var/lib/dpkg/info/libncurses5:amd64.symbols
  /var/lib/dpkg/info/libncursesw5-dev:amd64.list
  /var/lib/dpkg/info/libncursesw5-dev:amd64.md5sums
  /var/lib/dpkg/info/libncursesw5-dev:amd64.postinst
  /var/lib/dpkg/info/libncursesw5:amd64.list
  /var/lib/dpkg/info/libncursesw5:amd64.md5sums
  /var/lib/dpkg/info/libncursesw5:amd64.postinst
  /var/lib/dpkg/info/libncursesw5:amd64.postrm
  /var/lib/dpkg/info/libncursesw5:amd64.shlibs
  /var/lib/dpkg/info/libncursesw5:amd64.symbols
  </code></pre>
  
  <p>So then I tried two variations of my makefile:</p>
  
  <pre><code>g++ -Wall -g -L/usr/lib/x86_64-linux-gnu/ -o $* $*.cpp -std=c++11 -lncurses
  </code></pre>
  
  <p>and</p>
  
  <pre><code>g++ -Wall -g -L/lib/x86_64-linux-gnu/ -o $* $*.cpp -std=c++11 -lncurses
  </code></pre>
  
  <p>which still gave me the errors <code>undefined reference to 'initscr'</code> (without <code>-lncurses</code>) or <code>/usr/bin/ld: cannot find -lncurses</code> (with it)</p>