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


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

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

Replies are listed 'Best First'.
Re^5: win32::printer 5.16 will not install
by blenkhn (Acolyte) on Dec 12, 2012 at 01:59 UTC
    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

        Thanks for your help, I feel a little brainless, I did do it after and it didn't seem work. should it be a batch file? is it a cplus program? when I ran it as a perl program I got this, I have included the comand string that i used. Please remember that I am using server 2003 for my server software

        C:\Documents and Settings\Administrator\Application Data\.cpanplus\5.16.1\build\ Win32-Printer-0.9.0>perl patch.pl -i./Win32-Printer-0.9.0-formingw.diff

        Bareword found where operator expected at patch.pl line 1, near "7P99xa" (Missing operator before P99xa?)

        Bareword found where operator expected at patch.pl line 2, near "7P99xa" (Missing operator before P99xa?)

        Number found where operator expected at patch.pl line 2, near "xs 2008" (Do you need to predeclare xs?)

        Number found where operator expected at patch.pl line 2, near "28 11" (Missing operator before 11?)

        Number found where operator expected at patch.pl line 3, near "xs 2012" (Do you need to predeclare xs?)

        Number found where operator expected at patch.pl line 3, near "09 21" (Missing operator before 21?)

        Array found where operator expected at patch.pl line 4, at end of line (Missing semicolon on previous line?)

        Array found where operator expected at patch.pl line 4, near "12 " (Missing operator before ?)

        Array found where operator expected at patch.pl line 17, near "7 " (Missing operator before ?)

        Bareword found where operator expected at patch.pl line 18, near "ebc" (Missing semicolon on previous line?)

        Array found where operator expected at patch.pl line 26, near "10 " (Missing operator before ?)

        Array found where operator expected at patch.pl line 41, near "7 " (Missing operator before ?)

        Bareword found where operator expected at patch.pl line 42, near "RETVAL" (Missing semicolon on previous line?)

        Array found where operator expected at patch.pl line 50, near "10 " (Missing operator before ?)

        syntax error at patch.pl line 1, near "7P99xa"

        Illegal octal digit '9' at patch.pl line 3, at end of line

        Illegal octal digit '8' at patch.pl line 3, at end of line

        syntax error at patch.pl line 22, near "//~"

        syntax error at patch.pl line 27, near "10 @@ "

        syntax error at patch.pl line 30, near "- }"

        syntax error at patch.pl line 37, near "//~"

        syntax error at patch.pl line 41, near "7 @@ "

        syntax error at patch.pl line 46, near "//~"

        syntax error at patch.pl line 51, near "10 @@ "

        patch.pl has too many errors.

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