libexo link error in Cygwin

David Mohr damailings at mcbf.net
Mon Jul 30 22:42:40 CEST 2007


Just from reading through your emails:
The errors you posted first read "undefined reference to `_hasmntopt'"
-- note the function name starts with an underscore, but you try to
define hasmntopt without the underscore.

Hope it helps,
~David

On 7/30/07, Nick Deubert <ndeubert at gmail.com> wrote:
> On 7/18/07, Nick Deubert <ndeubert at gmail.com> wrote:
> > I'm trying to build libexo from svn on cygwin and I've run into this
> error:
>
> Well after doing some research I found some evidence (
> http://webcvs.freedesktop.org/xorg/xc/programs/Xserver/hw/xwin/InitOutput.c?revision=1.1.4.1.2.46&view=markup&pathrev=CYGWIN)
> that cygwin did not provide hasmntopt so I tried doing this:
>
> Index: exo-mount-point.c
> ===================================================================
> --- exo-mount-point.c   (revision 25926)
> +++ exo-mount-point.c   (working copy)
> @@ -187,6 +187,37 @@
>
>
>
> +#if defined(G_OS_WIN32)
> +const char* hasmntopt (const struct mntent *mnt,
> +                       const char *opt)
> +{
> +  const char* s;
> +  size_t len;
> +
> +  if (mnt == NULL)
> +    return NULL;
> +
> +  if (opt == NULL)
>  +    return NULL;
> +
> +  if (mnt->mnt_opts == NULL)
> +    return NULL;
> +
> +  len = strlen (opt);
> +  s = strstr (mnt->mnt_opts, opt);
> +
> +  if (s == NULL)
> +    return NULL;
> +
> +  if ((s == mnt->mnt_opts || *(s-1) == ',') && (s[len] == 0 || s[len] ==
> ','))
> +    return (char*)opt;
> +
> +  return NULL;
> +}
> +#endif
>
>  but apparently G_OS_WIN32 did not resolve to true for me or I did something
> else wrong. So I tried taking out the #ifdef just to see if it worked and
> then I get:
> exo-mount-point.c:192: error: conflicting types for 'hasmntopt'
> /usr/include/mntent.h:34: error: previous declaration of 'hasmntopt' was
> here
> exo-mount-point.c:192: error: conflicting types for 'hasmntopt'
> /usr/include/mntent.h:34: error: previous declaration of 'hasmntopt' was
> here
> make[3]: *** [libexo_0_3_la-exo-mount-point.lo] Error 1
>
> So then I do some grepping and found that /usr/include/mntent.h provides:
> char *hasmntopt (const struct mntent *__mnt, const char *__opt);
>
> So now I'm confused why it didn't find it in the first place? Any one have
> any ideas? Any help would be greatly appreciated.
> Thanks,
>  Nick
>
> _______________________________________________
> Xfce mailing list
> Xfce at xfce.org
> http://foo-projects.org/mailman/listinfo/xfce
> http://www.xfce.org
>



More information about the Xfce mailing list