title: How can I link PDCurses using gcc on Windows?
body: <p>Recently I installed PDCurses 3.6 (latest version) on my HP Pavilion laptop with Windows 7 Home Premium. Also I have installed MinGW-w64 (latest version too).</p>
  
  <p>Well, I started to learn how to use the curses mode <a href="http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/" rel="nofollow noreferrer">here</a>, and downloaded their example codes (<a href="http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/ncurses_programs.tar.gz" rel="nofollow noreferrer">ncurses_programs.tar.gz</a>); at this point all was OK.
  After unzipping the programs, I wanted to make use of the Makefile to have all the .exes already made. <strong>Here is the problem.</strong></p>
  
  <p>I ran cmd.exe, moved to the folder where the programs are, and then typed <code>mingw32-make -f Makefile</code>. This is the following process:</p>
  
  <pre><code>mingw32-make[1]: Entering directory 'C:/.../ncurses_programs/JustForFun'
  gcc -o hanoi.o -c hanoi.c
  
  /* throws some warnings */
  
  gcc -o ../demo/exe/hanoi hanoi.o -lncurses
  C:/MinGW/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64w64-mingw32/bin/ld.exe: cannot find -lncurses
  collect2.exe: error: ld returned 1 exit status
  mingw32-make[1]: *** [Makefile:20: ../demo/exe/hanoi] Error 1
  rm hanoi.o
  mingw32-make[1]: Leaving directory 'C:/.../ncurses_programs/JustForFun'
  mingw32-make: *** [Makefile:4: all] Error 2
  </code></pre>
  
  <p>Well, you surely are thinking "man, it's trying to link ncurses and you have pdcurses because you are on Windows". Yes, I know it. That's why I edited the Makefile, typing <code>LIBS=-lpdcurses</code> instead <code>LIBS=-lncurses</code>, but it doesn't find it neither.</p>
  
  <p>I know where <code>pdcurses.a</code> is, so I tried to compile a simple program (print 'Hello World!') by console like this:</p>
  
  <pre><code>gcc -LC:\PDCurses\wincon -lpdcurses -o myprogram myprogram.c
  </code></pre>
  
  <p>I still getting:</p>
  
  <pre><code>C:/MinGW/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lpdcurses
  collect2.exe: error: ld returned 1 exit status
  </code></pre>
  
  <p>I don't know what else can I do...</p>
  
  <p>Thank you beforehand!</p>