http://www.perlmonks.org?node_id=1008034


in reply to Re^2: win32::printer 5.16 will not install
in thread win32::printer 5.16 will not install

Taken from my command line: Please help, I must be doing something wrong as I am having a hard time installing it using nmake as well.

For some reason you don't appear to be reading the "error" messages

  • Comment on Re^3: win32::printer 5.16 will not install

Replies are listed 'Best First'.
Re^4: win32::printer 5.16 will not install
by Anonymous Monk on Dec 10, 2012 at 23:28 UTC

    cpanp -z Win32::Printer

    patch -p1 -i./Win32-Printer-0.9.0-formingw.diff

    Win32-Printer-0.9.0-formingw.diff

    diff -ruN Win32-Printer-0.9.0-7P99xa/Printer.xs Win32-Printer-0.9.0-ne +w/Printer.xs --- Win32-Printer-0.9.0-7P99xa/Printer.xs 2008-04-28 11:40:34.00000 +0000 -0700 +++ Win32-Printer-0.9.0-new/Printer.xs 2012-12-09 21:22:29.32812500 +0 -0800 @@ -24,6 +24,12 @@ #include <winspool.h> #include <commdlg.h> + +#define _int16 __int16 + + + + //------------------------------------------------------------------- +---------// LPWSTR ToWide( @@ -1334,7 +1340,7 @@ ebc.flags = flags; ebc.baw = baw; ebc.bah = bah; - __try { +//~ __try { if (emf) { brush = GetCurrentObject(hdc, OBJ_BRUSH); font = GetCurrentObject(hdc, OBJ_FONT); @@ -1352,10 +1358,10 @@ if (emf) { emf = CloseEnhMetaFile(hdc); } - } - __except (exfilt()) { - RETVAL = 64; - } +//~ } +//~ __except (exfilt()) { +//~ RETVAL = 64; +//~ } #else croak("EBbl is not supported in this build!\n"); #endif @@ -1398,7 +1404,7 @@ RETVAL = NULL; #ifdef FREE SetCurrentDirectory(dir); - __try { +//~ __try { if (Type == FIF_UNKNOWN) { Type = FreeImage_GetFIFFromFilename(BmpFile); if (Type == FIF_UNKNOWN) { @@ -1429,10 +1435,10 @@ } else { Image = 0; } - } - __except (exfilt()) { - Image = 0; - } +//~ } +//~ __except (exfilt()) { +//~ Image = 0; +//~ } #else croak("FreeImage is not supported in this build!\n"); #endif @@ -1827,7 +1833,7 @@ CODE: RETVAL = NULL; #ifdef GHOST - __try { +//~ __try { if (gsapi_new_instance(&minst, NULL) == 0) { sprintf(pdfpath, "-sOutputFile=%s", pdf); if (gsapi_init_with_args(minst, gsargc, (LPSTR *)gsargv) == 0 +) { @@ -1836,8 +1842,8 @@ } gsapi_delete_instance(minst); } - } - __except (exfilt()) { } +//~ } +//~ __except (exfilt()) { } #else croak("Ghostscript is not supported in this build!\n"); #endif
      Hi thanks for your help. The problem that I have is that this is above my head. I wrote the programs I use a few years back when it was easy to install and I don't really want to go backwards and install all of this over again.

      I created a new file called what you suggested and put in the contents like you said and then ran this and this is what I got.

      C:\>cpanp -z Win32::Printer patch -p1 -i./Win32-Printer-0.9.0-formingw.diff
      Set up gcc environment - 3.4.5 (mingw-vista special r3)
      ERROR 'patch' does not contain an author part

      ERROR Cannot find 'patch' in the module tree

      No such module: patch
      Key 'p1' is not a valid key for CPANPLUS::Internals::Fetch::_fetch provided by C PANPLUS::Module::fetch at C:/Perl/lib/CPANPLUS/Module.pm line 580.
      Microsoft Windows Version 5.2.3790
      (C) Copyright 1985-2003 Microsoft Corp.

      C:\Documents and Settings\Administrator\Application Data\.cpanplus\5.16.1\build\ Win32-Printer-0.9.0>

      Could you please give me more defined steps so that I can get this accomplished. I would be in your debt.

        LOL!

        patch is a program you run after you run the cpanp command