Author Topic: Compiling pdcurses with mingw on windows  (Read 5690 times)

Offline Lefteris

  • Multiple posting newcomer
  • *
  • Posts: 14
Compiling pdcurses with mingw on windows
« on: July 17, 2009, 12:47:27 am »
Hey all,

I wanted to use pdcurses in windows in a simple console application I am making. My IDE is codeblocks but before everything else I had to compile pdcurses. According to what I read from googling and according to the readme file it should have been pretty straightforward. I should just get to the directory of pdcurses/win32 and when in there issue the following command:

mingw32-make -f mingwwin32.mak     (since I am using gcc). The problem with this is that it gives errors while making. Do you have any idea what I am doing wrong? I am really scratching my head and trying to google for a similar problem but I get nothing. Any help would be appreciated. Here are the errors :

Code: [Select]
a - pdcdisp.o
a - pdcgetsc.o
a - pdckbd.o
a - pdcscrn.o
a - pdcsetsc.o
a - pdcutil.o
copy pdcurses.a panel.a
process_begin: CreateProcess(NULL, copy pdcurses.a panel.a, ...) failed.
make (e=2): The system cannot find the file specified.
mingw32-make: [pdcurses.a] Error 2 (ignored)
gcc -O2 -Wall -I.. -otestcurs.exe ../demos/testcurs.c pdcurses.a
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cceiQplg.o:testcurs.c:(.text+0x71c): undefine
d reference to `__ctype_ptr'
pdcurses.a(initscr.o):initscr.c:(.text+0xed): undefined reference to `_impure_pt
pdcurses.a(initscr.o):initscr.c:(.text+0x31c): undefined reference to `_impure_p
pdcurses.a(initscr.o):initscr.c:(.text+0x352): undefined reference to `_impure_p
pdcurses.a(initscr.o):initscr.c:(.text+0x388): undefined reference to `_impure_p
pdcurses.a(initscr.o):initscr.c:(.text+0x3be): undefined reference to `_impure_p
pdcurses.a(pdcscrn.o):pdcscrn.c:(.text+0x802): more undefined references to `_im
pure_ptr' follow
collect2: ld returned 1 exit status
mingw32-make: *** [testcurs.exe] Error 1

Online stahta01

  • Lives here!
  • ****
  • Posts: 5528
    • My Best Post
Re: Compiling pdcurses with mingw on windows
« Reply #1 on: July 17, 2009, 06:46:11 am »
Re-install MinGW and If you have Vista make sure it is a MinGW GCC that works with Vista.

NOTE: This post has little to do with Code::Blocks; so, it likely will be locked.

See Link; Q6 does not necessarily have the exact cause of your problem;
But, please read the makefile to see what commands it expects to exist.
I am guessing, the "copy" command is missing from the message.

Note: I just read the make file and the copy command failing might be normal.

I suggest posting more info in a better group for this type of problem.
The minimal info is:
OS: example XP
OS Version: example XP SP3
MinGW GCC Version: example 3.4.5 (mingw-vista special r3)
Library Name and Version: example pdcurses CVS

Tim S
« Last Edit: July 17, 2009, 07:11:44 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
When in doubt, read the CB WiKi FAQ.

Offline Lefteris

  • Multiple posting newcomer
  • *
  • Posts: 14
Re: Compiling pdcurses with mingw on windows
« Reply #2 on: July 17, 2009, 08:45:24 am »
Hello and thanks for your reply. I realize that this is not codeblocks related. My OS is XP SP3 and the mingw gcc is indeed 3.4.5.  You were right on.

I will post this in another forum too if this gets locked I guess. Again thanks for your reply.


I managed to find what was wrong. The problem lied with io.h of mingw. In my system I had two microprocessor toolchains installed. One for AVR family of processors and one for the blackfin one. Somehow they messes up my mingw's io.h.

In order to correct it I just removed the two aforementioned toolchains from my System's PATH and it compiled perfectly and is now working perfectly with my codeblocks project :)
« Last Edit: July 17, 2009, 02:40:12 pm by Lefteris »