Problems using the PDcurses library VS2013

Recently, I have discovered PDcurses. However, my attempts to use it in Visual Studio 2013 have failed. I have been searching Google, and I can't find an up to date answer on how to use PDcurses. I've checked posts on just how to link any library, however, these have not helped.

Are any of you familiar with using PDcurses with Visual Studio 2013? How did you go about doing so?
I am going to assume pdcurses has not been built. These steps worked for me, hopefuly they will for you too.

BUILDING THE LIBRARY:
1. Download and extract the zip file http://sourceforge.net/projects/pdcurses/files/latest/download?source=files

2. Open a visual studio command prompt by navigating to
All Programs > Microsoft Visual Studio 2013 > Visual Studio Tools
Select the x86 native command prompt if you want to build the library 32 bit,
x64 native command prompt if you want to build it 64 bit.

NOTE: For 64 bit you will need to edit the makefile vcwin32.mak changing the line (109 for me)
cvtres /MACHINE:X86 /NOLOGO /OUT:pdcurses.obj pdcurses.res
to
cvtres /MACHINE:X64 /NOLOGO /OUT:pdcurses.obj pdcurses.res


3. Change directory to the win32 directory in the pdcurses directory you extracted
(C:\Users\%USERNAME%\Downloads\pdcurs34\win32 for me)

4. Run
nmake -f vcwin32.mak
from the VS command prompt. If it builds successfuly two files,
pdcurses.lib and panel.lib will be in the win32 folder.

5. Copy them to a permanent location such as C:\pdcurses\lib. Then copy the headers from the pdcurses and win32
folder to a permanent location (C:\pdcuses\include). The headers are
curses.h  curspriv.h  panel.h  pdcwin.h  term.h


6. If you want to build debug and/or dynamic (DLL) versions of the library go back to step 4
changing the nmake command to
nmake -f vcwin32.mak DLL=Y
for dynamic libraries, or
nmake -f vcwin32.mak DEBUG=1
for debug builds.

NOTE: Before advancing to step 5, consider renaming the libs to reflect their type.
I rename debug libs adding -d to the name EX: (pdcurses-d.lib)


CONFIGURE VISUAL STUDIO
7. Edit a projects properties (either a new or existing project) Select the Edit menu > <project name> properties.

8. In the property manager, select Configuration Properties > VC++ Directories.
Add the path to the headers (C:\pdcurses\include) to Include Directories.

Also add the library path to Library Directories.(C:\pdcurses\lib)

9. Select Configuration Properties > Linker and add the library path to Additional Library Directories.

10. Select Linker > Input and add panel.lib and pdcurses.lib (adjust names to suit configuration type if you changed them).

11. Repeat from step 8 for the inactive configuration. If release is the active (current) configuration you will need to
repeat for debug.

You should be ready to run pdcurses now.
Last edited on
Actually, it was previously built. I found the error, a very simple one, in where I needed to add it. It turns out that you need to add it to "Additional Include Directories" under C/C++-->General on property pages, and not just under "Additional Library Directories" under Linker-->General. I'm not sure if both is needed or just the former. (But you do need to add the lib under Linker-->Input)
Topic archived. No new replies allowed.