在Windows上编译单声道时出错:i686-pc-mingw32 / bin / ld:找不到-ldl

时间:2014-11-04 03:51:27

标签: mono cygwin mingw

我正在尝试使用cygwin在Windows上编译mono,但是当我运行make时,它最终会因以下错误而停止

make[3]: Entering directory '/cygdrive/c/Projects/mono/mono/metadata'
  CCLD     pedump.exe
/usr/lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/bin/ld: cannot find -ldl
collect2: error: ld returned 1 exit status
Makefile:1303: recipe for target 'pedump.exe' failed
make[3]: *** [pedump.exe] Error 1
make[3]: Leaving directory '/cygdrive/c/Projects/mono/mono/metadata'
Makefile:434: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/cygdrive/c/Projects/mono/mono'
Makefile:518: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/cygdrive/c/Projects/mono'
Makefile:445: recipe for target 'all' failed
make: *** [all] Error 2

我只能假设我错过了我的cygwin安装中的一些内容,但除了它可能是一个名为libdl的库之外,我无法确定它是什么。

我一直关注此guide on codeproject并使用此yaml file作为参考。

1 个答案:

答案 0 :(得分:2)

代码项目文章可能不完整,最后我得到以下工作

我首先使用(从mono/Appveyor.yml解释)

setup-x86.exe -qnNdO -R "C:\cygwin" -s "http://cygwin.mirror.constant.com" 
  -l "C:\cygwin\var\cache\setup" -P autoconf -P automake -P bison -P gcc-core 
  -P gcc-g++ -P mingw-runtime -P mingw-binutils -P mingw-gcc-core -P mingw-gcc-g++ 
  -P mingw-pthreads -P mingw-w32api -P libtool -P make -P python -P gettext-devel 
  -P gettext -P intltool -P libiconv -P pkg-config -P git -P wget -P curl

然后从cygwin提示符(上面和代码项目文章的组合" How-to-build-Mono-on-Windows")

NOCONFIGURE=1 ./autogen.sh --prefix="C:\monoinstall" --with-preview=yes
./configure --host=i686-pc-mingw32
make get-monolite-latest
make
mount "C:\monoinstall" /usr/local 
make install

cd /cygdrive/c/monoinstall/bin
rm mono
cp /cygdrive/c/Program Files (x86)/Mono-3.2.3/bin/mono.exe /cygdrive/c/monoinstall/bin
rm mcs
cp /cygdrive/c/Program Files (x86)/Mono-3.2.3/bin/mcs.bat /cygdrive/c/monoinstall/bin