Code::Blocks Forums

User forums => Help => Topic started by: Dark_Oppressor on April 03, 2007, 11:20:33 am

Title: Pdcurses
Post by: Dark_Oppressor on April 03, 2007, 11:20:33 am
I am attempting to write a roguelike(maybe not the best way to learn c++, oh well), and have decided I want to use pdcurses to that end.  How would I go about setting up Codeblocks and pdcurses so that I can use it?  I have attempted to set it up with the compiler I am currently using(GCC), but I am unable to compile and run any of the demo programs that come with pdcurses.  Does pdcurses itself have to be compiled first?
Title: Re: Pdcurses
Post by: Biplab on April 03, 2007, 12:06:25 pm
Pdcurses 3.0 comes with source only. But compilation is easy.

1. Download the source and extract it to a folder. Then issue the following command at command prompt:
Code
set PDCURSES_SRCDIR=<pdcurse_source>

2. Change directory to <pdcurse_source>\win32 directory. Now, depending upon your choice of compiler, issue a command to compile. I'm using MSVC and I've used:
Code
nmake -f vcwin32.mak
For MinGW (GCC) type,
Code
mingw32-make -f mingwin32.mak

It will compile your the pdcurse and samples.

To create app follow the steps (I've tested with MSVC 7.1)
a) Create a Console app.
b) Remove the auto-generated file and add a file from demo directory of pdcurse.
c) Add panel.lib, pdcurses.lib, user32.lib and advapi32.lib to it.
d) Add the directories pointing curses.h, pdcwin.h and libraries to Project.

Now it should compile.

Regards,

Biplab
Title: Re: Pdcurses
Post by: Dark_Oppressor on April 03, 2007, 09:16:19 pm
Ok, apparently you can't just install mingw, you have to manually do quite a few things before it will work.  I have setup its bin directory in my PATH, and it will finally start trying to compile something, but I always get an error such as this:

C:\pdcurses\win32>mingw32-make -f mingwin32.mak
gcc -c -O2 -Wall -IC:\pdcurses C:\pdcurses/pdcurses/addch.c
gcc: installation problem, cannot exec `cc1': No such file or directory
mingw32-make: *** [addch.o] Error 1

I believe this is a problem with the compiler, because I also tried using g++ to compile a program of mine that I know is fine, and I get this:

g++: installation problem, cannot exec `cc1plus': No such file or directory
Title: Re: Pdcurses
Post by: TDragon on April 03, 2007, 11:23:17 pm
..., but I always get an error such as this:
...
gcc: installation problem, cannot exec `cc1': No such file or directory
...
g++: installation problem, cannot exec `cc1plus': No such file or directory
These errors are one of the symptoms of trying to use MinGW on Windows Vista; are you? If so, a search on the C::B forums (or elsewhere) will turn up some workarounds.

If not, generally the best thing to do is totally delete everything and reinstall from scratch.
Title: Re: Pdcurses
Post by: Dark_Oppressor on April 04, 2007, 12:49:42 am
Nope, I'm on XP.  I'll try reinstalling in a bit, but I just installed Mingw a few days ago in the first place.