Good day,

I have been told that the followng procedure might be helpful to some of the
users of this Mailing List so I would like to present it here for the use of any
one who had a similar need as I had.

---------------------------------------------------------------------------------

My Problem
   I'm attempting to create a Program on a Linux System that will be able
   to be run on a Windows System. This program uses the CURSES feature.
   I do not want the Windows system to have to worry about needing a DLL
   and so I will create the PDCurses library statictly.

My Environment
   Development Computer
      Pentium     4
      Linux        2.4.18
      Caldera    2.3
      Mingw      1.1
      PDCurses 2.4
   Production Computer
      Compaq    i486
      Windows   95

Install Procedure
1.   I had generated MINGW as a Cross Compiler for creating Windows formated
     Object Modules using the procedure described by Reinhard Jessich at his 
     site, members.telering.at/jessich/mingw.
2.   I downloaded PDCurses version 2.5 from the Site pdcurses.sourceforge.net
     The file was PDCurses-2.5.tar.gz
3.   The file was put into a Directory called /Programs     
     CD /Programs
     tar -xzf PDCurses-2.5.tar.gz
     This created a directory called PDCurses-2.5
4.   CD PDCurses-2.5
     CD win32
5.   You will see a list of *.mak files.
     I choose the gccwin32.mak as the Base for building this Product.
6.   Create a Directory to Build the Product
     MKDIR Build
     Copy gccwin32.mak to the Build directory as the Makefile
     CP gccwin32.mak Build/Makefile
     CD Build
7.   Edit the Makefile and make the following changes for running under Mingw
     A.   Line 15 - PDCURSES_HOME = /Programs/PDCurses-2.5
     B.   Line 16 - CC_HOME = /usr/local/cross-tools/bin/mingw32-gcc
                    Note - this is where the Mingw GCC cross compiler is on
                           my System
     C.   Line 34 - CC = /usr/local/cross-tools/bin/mingw32-gcc
     D.   Line 40 - CFLAGS = -c -O -Wall -static
                    Note - this is to create the Static Library.
     E.   Line 48 - LINK = /usr/local/cross-tools/bin/mingw32-gcc
     F.   Line 53 - LIBEXE = /usr/local/cross-tools/bin/mingw32-ar
8.   Now do the Make
     make all
     The important file that this operation will create for you will be the
     pdcurses.a archive file.
9.   The last step in this procedure is to move the two (2) files needed
     by PDCurses under Mingw to their final directories.
     A.   Copy the pdcurses.a file to the Library directory used by Mingw
          under the name of "libpdcurses.a"  
          CD /usr/local/cross-tools/mingw32/lib
          CP -a /Programs/PDCurses-2.5/win32/Build/pdcurses.a libpdcurses.a
     B.   Then copy the curses.h file to the include directory used by Mingw
          CD /usr/local/cross-tools/mingw32/include
          CP -a /Programs/PDCurses-2.5/curses.h curses.h

Testing Procedure
In order to test out whether PDCurses works correctly under Mingw,
I have a little IVP (Installation Verification Program) that I found on
the Net somewhere.
1.   VI  Sample.c
         #include <curses.h>
         int main(int argc, char** argv)
            {
            initscr();
            wclear(stdscr);
            waddstr(stdscr, "hello world");
            wrefresh(stdscr);
            getch();
            endwin();
            }
2.   To compile the program, the command on my system is:
     /usr/local/cross-tools/bin/mingw32-gcc Sample.c -lpdcurses -o sample.exe
3.   Then I dumped the sample.exe program to a Floppy and brought it over
     to my Windows System.
4.   I ran it from both the straight Windows environment by double clicking
     on the program and also from within a MS-DOS Prompt window and it ran
     perfect in both tests.

I hope that this Procedure and information is of use to people who which
to use pdcurses as part of mingw.

Yours truly,

Frank Krauss
        


























On Tue, 20 Aug 2002, Frank Krauss wrote:
> Good day,
> 
> My Problem
>    I'm attempting to create a Program on a Linux System that will be able
>    to be run on a Windows System. This program uses the CURSES feature and
>    I'm having problems in generating a successfull load Module.
> 
> My Environment
>    Development Computer
>       Pentium  4
>       Linux    2.4.18
>       Caldera  2.3
>       Mingw    1.1
>       PDCurses 2.4
>    Production Computer
>       Compaq   i486
>       Windows  95
> 
> Processing
>    I generated MINGW as a Cross Compiler for creating Windows formated Object
>       Modules using the procedure described by Reinhard Jessich at his site 
>       members.telering.at/jessich/mingw.
>    The pdcurses-mingw32-libs.tar.gz file that I installed had two versions of
>       the Library in it:
>          libcurses.a 
>          libpdcurses.a
>    
> Errors
>    When I use Mingw to create a Load modules and specify -lpdcurses, it
>    assembles fine but when I bring it over to the Windows System to run it,
>    I get the following message:
>       A required DLL file, PDCURSES.DLL was not found.
>    I cannot find any mention on the Net on where I can get a copy of this
>    DLL or how I can create it.
>    
>    I saw a posting from someone saying that Mingw supplied two PDC libraries,
>    one called libpdcurses for use with Dynamic Linking and another called 
>    libpdcurses_s.a for Static linking.  I assume that if I used a static
>    library, I wouldn't get the problem of the missing PDCURSES.DLL file.
>    I cannnot find any mention on the Net on where I can get this Static Library.
>    It was not part of the files from Mingw.
> 
>    I thought that perhapes I should try using the libcurses.a library since
>    it might be the static library.  When I did an assembly using that one,
>    I received a number of the followng messages:
>       undefined references to __imp_iob.
> 
> Summary
>    My questions to everyone reading this note are the following:
>    1.   Can someone tell me where I can find a copy of the PDCURSES.DLL file
>         or how it can be created?
>    2.   Can someone tell me how I can get a copy of the libpdcurses_s.a file
>         if that is the library to be used to do static compiles?
>    3.   Can anyone tell me how to get around the problem of the undefined
>         references to __imp_iob?
> 
> Any assistance in helping me to get PDCurses to run with Mingw will be
> greatly appreciated.
> 
> Yours truly,
> 
> Frank Krauss

Reply via email to