in reply to Net::LibIDN in Windows, is it possible?

I guess your stated hatred for the platform you're working on prevented you from showing us what exact problems you're facing while installing Net::LibIDN. Most likely this is a problem of not having the prerequisites, like (likely) the libidn external library. But it's hard to know without knowing more specifics.

After Update:

Set up gcc environment - 3.4.5 (mingw-vista special r3) ... 'cc' is not recognized as an internal or external command, operable program or batch file. __test1.c:1:18: idna.h: No such file or directory

This seems to be a configuration problem with the module, because it seems to be hardcoded to use cc, a program which is not installed on your machine. Most likely you can fix that by replacing every instance of cc by $Config{cc}, which for your installation likely should be gcc or gcc.exe.

But that seems not to be all, because something somewhere seems to find your gcc, which then complains about idna.h not being found. So maybe you don't have either the environment variables for your C compiler set up to also include the paths of the headers and library files ($ENV{INCLUDE}, $ENV{LIB}), or you don't have these.

As Net::LibIDN is under the Artistic License, it's unlikely that it includes the libidn libraries.

Replies are listed 'Best First'.
Re^2: Net::LibIDN in Windows, is it possible?
by dHarry (Abbot) on Feb 05, 2009 at 14:21 UTC

    it's unlikely that it includes the libidn libraries

    It doesn't, get them from libidn.

      Here are the current errors I get now.

      It complains about idn-int.h. That file is in libidn-1.9\win32\include, not libidn-1.9\lib like idna.h is. Any ideas on how to use both directories at the same time? (I'm sure I sound like an idiot, sorry.)

      C:\Perl\cpan\build\Net-LibIDN-0.11-QaNUHQ>perl Makefile.PL --with-libi +dn=libidn- 1.9 --with-libidn-inc=libidn-1.9\lib Set up gcc environment - 3.4.5 (mingw-vista special r3) In file included from __test1.c:1: libidn-1.9/lib/idna.h:31:38: idn-int.h: No such file or directory In file included from __test1.c:1: libidn-1.9/lib/idna.h:67: error: syntax error before '*' token libidn-1.9/lib/idna.h:69: error: syntax error before '*' token libidn-1.9/lib/idna.h:74: error: syntax error before '*' token libidn-1.9/lib/idna.h:82: error: syntax error before '*' token libidn-1.9/lib/idna.h:86: error: syntax error before "uint32_t" This module requires GNU Libidn, which could not be found.

      While I ask a lot of Win32 questions, I hate Windows with a passion. That's the problem with writing a cross-platform program. I'm a Linux user myself. I wish more people were.
      If you want to do evil, science provides the most powerful weapons to do evil; but equally, if you want to do good, science puts into your hands the most powerful tools to do so.
      - Richard Dawkins
        Any ideas on how to use both directories at the same time?

        Include directories (i.e. where the compiler looks for header files — in addition to the standard places) are specified via the -I option to gcc (multiple occurrences of -I are allowed).  So, the following perl Makefile.PL option should achieve the desired effect (untested, though):

        --with-libidn-inc="libidn-1.9\lib -Ilibidn-1.9\win32\include"

        Due to this snippet from Makefile.PL

        GetOptions ( ... "with-libidn-inc=s" => \$incdir, );

        the value "libidn-1.9\lib -Ilibidn-1.9\win32\include" is being assigned to $incdir, which is then interpolated here

        $Params{INC} = "-I$incdir";

        IOW, $Params{INC} now holds the two -I options, which in turn should end up in the appropriate places in the generated Makefile...

        (In case that doesn't work, you might want to try specifying absolute paths to the include directories.)

        Reading Makefile.PL, I guess you could play games like "--with-libidn=libidn-1.9 -Lc:\other\directory". Or you could edit the Makefile.PL to handle your case more gracefully. Or you could simply copy all relevant files into one directory.

Re^2: Net::LibIDN in Windows, is it possible?
by wilsond (Scribe) on Feb 05, 2009 at 14:05 UTC

    Sorry, I had submitted my question before I was really done. I just added the extra info.


    While I ask a lot of Win32 questions, I hate Windows with a passion. That's the problem with writing a cross-platform program. I'm a Linux user myself. I wish more people were.
    If you want to do evil, science provides the most powerful weapons to do evil; but equally, if you want to do good, science puts into your hands the most powerful tools to do so.
    - Richard Dawkins