jblevin has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

I'm running into problems trying to install Net-Pcap-0.14. I run 'perl Makefile.PL INC=... LIBS=...' (INC and LIBS path details left out)

I get the following error:

error: system call to 'cc -E -I/usr/add-on/exptools/lib/pcap/include -DHAVE_BLANK -DHAVE_PCAP_LIB_VERSION find-funcs.h -o cpp-out.h' failed at Makefile.PL line 326.

I see in the README file, "To install the extension in a private directory, you can use the PREFIX option when creating Makefile.PL". I don't know if the reason for the above error is that I need to tell it to install the extension in a private directory. If so, I don't know what it means to "use the PREFIX option when creating Makefile.PL". Makefile.PL is already created in the downloaded package. I don't see any PREFIX option in Makefile.PL. I tried to run 'perl Makefile.PL PREFIX=..." to point to my private path, this didn't work either.

Seems like they are leaving out some of the details here. Any tips would be greatly appreciated - Thanks!

Replies are listed 'Best First'.
Re: Net::Pcap install problem
by jettero (Monsignor) on Jul 06, 2007 at 19:47 UTC
    It's just a guess, but I'd say you don't have a compiler.

    What happens if you try typing "cc" at the command line?

    (What perl and what platform? I may have better guesses knowing those.)

    -Paul

      This is the C compiler on SUN Solaris 2.8. Path to compiler is /opt/sc6.2a/SUNWspro/bin/cc.

      If I run at command line, I get

      cc -E -I/usr/add-on/exptools/lib/pcap/include -DHAVE_BLANK -DHAVE_PCAP_LIB_VERSION find-funcs.h -o cpp-out.h

      cc: illegal suffix of output filename

      Perl version is 5.005_03, but I tried running it again with perl 5.6.1, and I get the same error message.

        It isn't perl that's at fault. Personally, I'd hit rt.cpan.org and report that it doesn't compile on solaris. But before I did that, I'd check to see if anyone else reported it. It seems to fail numerous places, but usually older versions.

        http://testers.cpan.org/show/Net-Pcap.html

        It's probably expecting gcc's argument forgiveness, which isn't reasonable with the solaris compiler. It's slightly more picky. My guess is that you could get it to work by farting around with the Build.PL or Makefile.PL, but it might be some work. If you posted that in your ticket... well, then you'd be cooking with fire.

        -Paul

        Solaris' system compiler apparently doesn't like -o in combination with -E — at least

        $ cc -flags | grep -- -E -E Compile source through preprocessor only, output to st +dout

        Maybe you could try redirecting the output

        cc -E ... find-funcs.h > cpp-out.h

        Just an idea...

        seems your compiler is peaky about the extension of the filename given in the -o <file> option. Does it work if you replace cpp-out.h with cpp.out for example?

        cheers --stephan