title: How to include or link ncurses/ curses library in Codeblocks 13.12 in Ubuntu 16.04?
body: <p>Hope you are doing great!</p>
  
  <p>I am using codeblocks 13.12 in my Elementary OS (Loki) which is based on ubuntu 16.04. Recently , I tried to use getch(), getche() function in my C-language coding and to do that i installed ncurses library in my system. When i try to build code, I get two error messages- </p>
  
  <ol>
   <li>Undefined reference to 'stdscr'</li>
   <li>Undefined reference to 'wgetch'</li>  
  </ol>
  
  <p>Here is my sample code: </p>
  
  <pre><code>#include'stdio.h'
  #include'ncurses.h'
  int main(){
      char ch;
      printf("Enter a character: ");
      ch=getch();
      printf("\nIts ASCII is : %d .",ch);
      return 0;
  }        
  </code></pre>
  
  <p>What is the solution?
  I know i have to link the library to my source code file in command line.</p>
  
  <p>Here is my command line execution :<br>
  <code>gcc -o example_3_1_1test1 example_3_1_1.c -lncurses</code></p>
  
  <p>complies without error  </p>
  
  <pre><code>Enter a character: 
  Its ASCII is : -1
  </code></pre>
  
  <p>which is wrong. Because my program don't take input from keyboard and   automatically returns -1.
  </p></p>
  
  <p>
  I want to build/complile my code from codeblocks automatically. So, how can i link ncurses library in codeblocks 13.12?
  </p>
  
  <p>Thanks in advance.</p>
  
  <p>Nazmul</p>