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

Hi there,
I want to install Prima module.
For that I need to install a host of libraries like jpeg,zlib, libiconv,glib,etc.
But I am not able to install libiconv-1.11.
I downloaded it from www.sunfreeware.com and I have also installed gettext which is necessary for libiconv.
Earlier, it was showing an error that wchar_c99.h was not found.
Then I got the header file from Koders website and copied it into the /usr/include/iso/ path.
Now it is showing the following error:

/usr/include/iso/wchar_c99.h:66: error: conflicting types for '_RESTRICT_KYWD'
/usr/include/iso/wchar_c99.h:66: error: previous definition of '_RESTRICT_KYWD' was here
/usr/include/iso/wchar_c99.h:69: error: redefinition of parameter '_RESTRICT_KYWD'
/usr/include/iso/wchar_c99.h:68: error: previous definition of '_RESTRICT_KYWD' was here
/usr/include/iso/wchar_c99.h:72: error: conflicting types for '_RESTRICT_KYWD'
/usr/include/iso/wchar_c99.h:71: error: previous definition of '_RESTRICT_KYWD' was here
*** Error code 1
make: Fatal error: Command failed for target `preloadable_libiconv_solaris.so'
Current working directory /export/home/NetDeposit/dps/libiconv-1.11/lib
*** Error code 1
make: Fatal error: Command failed for target `all'
Can anybody help me with it?
Thanks in advance,
Krishi.

Replies are listed 'Best First'.
Re: installing libiconv library
by plobsing (Friar) on Dec 12, 2007 at 10:28 UTC
    Looking at the file in question, it appears that all the errors are stemming from function signatures (in which multiple arguments have the same dummy argument name).
    My C is a little rusty, but as I remember, you can omit the dummy argument names on declarations. This would give you (lines 63-80):
    ... #if defined(_STDC_C99) || \ (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \ defined(_XPG6) || defined(__EXTENSIONS__) extern int vfwscanf(__FILE *, const wchar_t *, __va_list); extern int vswscanf(const wchar_t *, const wchar_t *, __va_list); extern int vwscanf(const wchar_t *, __va_list); extern float wcstof(const wchar_t *, wchar_t **); #if defined(_LONGLONG_TYPE) extern long double wcstold(const wchar_t *, wchar_t **); extern long long wcstoll(const wchar_t *, wchar_t **, int); extern unsigned long long wcstoull(const wchar_t *, wchar_t **, int); #endif /* defined(_LONGLONG_TYPE) */ ...
      Thank you very much plobsing...
      Your suggestion worked!!
      And almut has also given a very good explanation.
Re: installing libiconv library
by almut (Canon) on Dec 12, 2007 at 12:22 UTC

    Just FYI, the _RESTRICT_KYWD is a macro declared in /usr/include/sys/feature_tests.h on newer (v10) Solaris systems (feature_tests.h itself is included from /usr/include/iso/stdio_iso.h):

    /* * The following macro defines a value for the ISO C99 restrict * keyword so that _RESTRICT_KYWD resolves to "restrict" if * an ISO C99 compiler is used and "" (null string) if any other * compiler is used. This allows for the use of single prototype * declarations regardless of compiler version. */ #if (defined(__STDC__) && defined(_STDC_C99)) #define _RESTRICT_KYWD restrict #else #define _RESTRICT_KYWD #endif

    However, as plobsing hinted at, you can probably get away without it.

    (This is a rather common source of various compilation problems, unfortunately.)

      Thank you almut...
      I got the mistake...
      As you mentioned, plobsing's solution worked.