Perl modules that require a C compiler to install will use the same compiler that was used to build the perl executable. You can verify the path and binary name of the compiler by looking at the output of

perl -V

What you seem to be saying is that you installed GCC, but when you use CPAN to install the module, you get an invocation of cc. You can work around this by making sure that the gcc path comes first. That is, if cc is in /usr/bin and gcc is in /usr/local/bin/gcc, then you'll want to make sure that /usr/local is in your path environment variable first. If you do a

which cc which gcc cc -v

You should be able to tell where cc is, where gcc is, and what happens when you run cc -v. If you get GCC installed and first in your path, then it by default has an executable called cc. If there isn't one, then you can create a symoblic link called cc that will ensure that gcc is being used. You know you've succeeded when the command line used to build Perl will invoke GCC instead of a system cc.

Note that I'm assuming you're on a UNIX or UNIX-like system, since most Windows Perls don't use 'cc'.

Note also that if you do this, the end results are NOT guaranteed to work. UNIX system C compilers differ in their binary output from GCC, and when trying to mix and match a cc Perl with GCC modules bad things can happen. Then again, it might work. I've been able to get such Franken distributions to function on more difficult platforms like HP-UX and AIX


In reply to Re: Problem while installing a module by Sinistral
in thread Problem while installing a module by abubacker

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.