English 中文(简体)
当 FreeBSD 无法找到 strndup 时,我如何修复 mod_mono 的构建?
原标题:How do I fix the build for mod_mono when it cannot find strndup on FreeBSD?

我正在FreeBSD上使用Apache 2安装mod_mono,当Apache尝试加载mod_mono.so模块时,我遇到了以下错误。

Cannot load /usr/local/apache/modules/mod_mono.so into server: /usr/local/apache/modules/mod_mono.so: Undefined symbol "strndup"

我为Apache设置的前缀是/usr/local/apache,并且我已经使PHP和其他模块运作。我发现strndup在/usr/include中的roken.h被引用,我尝试了以下添加到configure命令中,但没有效果。

libdir=/usr/lib --includedir=/usr/include的中文翻译为:libdir = / usr / lib --includedir = / usr / include

我也尝试过... (wǒ yě chángshìguò...)

--with-mono-prefix=/usr 使用-Mono前缀=/usr

我不知道下一步要做什么。 看来莫德-莫罗有许多选择。 由于Mono和XSP都是成功地建造的,我只需要 mo魔。

我很感激任何让这个工作起来的提示。

最佳回答

通过实现添加strndup:

ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#if !_LIBC
# include "strndup.h"
#endif

#include <stdlib.h>
#include <string.h>

#if !_LIBC
# include "strnlen.h"
# ifndef __strnlen
#  define __strnlen strnlen
# endif
#endif

#undef __strndup
#if _LIBC
# undef strndup
#endif

#ifndef weak_alias
# define __strndup strndup
#endif

char *
__strndup (s, n)
     const char *s;
     size_t n;
{
  size_t len = __strnlen (s, n);
  char *new = malloc (len + 1);

  if (new == NULL)
    return NULL;

  new[len] =   ;
  return memcpy (new, s, len);
}
#ifdef libc_hidden_def
libc_hidden_def (__strndup)
#endif
#ifdef weak_alias
weak_alias (__strndup, strndup)
#endif
问题回答

暂无回答




相关问题
What are some things Mono is not a good fit for?

I ve started your typical web project from scratch using the Mono platform. You know, web services, a UI, MySQL database, all that. I ve heard around the net that it s not a picture-perfect ...

How Reliable is Mono on Linux vs .NET on Windows?

I am trying to decide upon using Mono with C# or Python (Django) for a Linux based Web Site. My concern with C# is that Mono may not be as reliable as .NET. Does anyone have any experience with this?

System.Data in Mono

Has System.Data in Mono been expanded to include extra functionality? I m attempting to make use of the SQL Parser written for Mono in Mono.Data.SqlExpressions but when all the classes in the ...

Basic MEF workflow/usage

I m looking to a framework which will allow me to have a simple plugin system in my .NET application. It seems MEF is the framework which Microsoft is endorsing, and will become part of .NET 4 (it ...

In Mono/Gnome, how can I look up the icon for a mime type?

Gnome.Icon and Gnome.ThumbnailFactory both want me to pass in a URI of a file whose icon I want -- I only have a MIME type, which I want to look up an icon for. Is there a GNOME C# API function which ...

ASP.NET MVC 2 on mono

Is it possible to run the new ASP.NET MVC 2 Preview 2 on mono?

热门标签