我正在尝试在RedHat 5.11上安装Mono。以下是我们尝试安装的单声道的一些细节。
安装步骤:
./configure --prefix=/opt/mono
make && make install
我们可以在CentOS上安装它,但是在RedHat上安装它会产生以下问题:
/usr/bin/ld: ./.libs/libmini.a(libmini_la-mini.o): relocation R_X86_64_PC32 against `mono_cross_helpers_run' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
我搜索了一下,发现了以下链接:how to recompile with -fPIC
要解决此问题,我尝试使用-fPIC
选项运行它,但后来我意识到-fPIC
选项不适用于RedHat,因此我使用了-pie
选项。然后我执行了以下步骤:
./configure --enable-shared --prefix=/opt/mono
make -pie
make install
但我仍有同样的问题:
/usr/bin/ld: ./.libs/libmini.a(libmini_la-mini.o): relocation R_X86_64_PC32 against `mono_cross_helpers_run' can not be used when making a shared object; recompile with -fPIC
我也在控制台上看到以下错误
make[7]: [cs-errors.tree] Error 1 (ignored)
make[7]: [ecma334.tree] Error 1 (ignored)
make[7]: [Mono.tree] Error 1 (ignored)
make[7]: [netdocs.tree] Error 1 (ignored)
make[7]: [Novell.tree] Error 1 (ignored)
make[8]: *** No rule to make target `../../class/lib/build/sn.exe', needed by `../../class/lib/xbuild_12/Microsoft.Build.Framework.dll'. Stop.
make[7]: [do-all] Error 2 (ignored)
make[8]: *** No rule to make target `../../class/lib/build/sn.exe', needed by `../../class/lib/xbuild_12/Microsoft.Build.Utilities.v12.0.dll'. Stop.
make[7]: [do-all] Error 2 (ignored)
make[8]: *** No rule to make target `../../class/lib/build/sn.exe', needed by `../../class/lib/xbuild_12/Microsoft.Build.Engine.dll'. Stop.
make[7]: [do-all] Error 2 (ignored)
make[8]: *** No rule to make target `../../class/lib/build/sn.exe', needed by `../../class/lib/xbuild_12/Mono.XBuild.Tasks.dll'. Stop.
make[7]: [do-all] Error 2 (ignored)
make[8]: *** No rule to make target `../../class/lib/build/sn.exe', needed by `../../class/lib/xbuild_12/Microsoft.Build.Tasks.v12.0.dll'. Stop.
make[7]: [do-all] Error 2 (ignored)
make[8]: *** No rule to make target `../../class/lib/build/sn.exe', needed by `../../class/lib/xbuild_12/Microsoft.Build.dll'. Stop.
make[7]: [do-all] Error 2 (ignored)
/bin/sh: .//mkinstalldirs: No such file or directory
make[7]: [../../class/lib/xbuild_12//.stamp] Error 127 (ignored)
touch: cannot touch `../../class/lib/xbuild_12//.stamp': No such file or directory
make[7]: [../../class/lib/xbuild_12//.stamp] Error 1 (ignored)
make[7]: [../../class/lib/xbuild_12/xbuild.exe] Error 1 (ignored)
Makefile:821: warning: overriding commands for target `mod'
Makefile:801: warning: ignoring old commands for target `mod'
make[3]: [AgilityPack.dll] Error 1 (ignored)
make[3]: [AgilityPack.dll] Error 1 (ignored)
make[3]: [convert.exe] Error 1 (ignored)
make[3]: [mono-file-formats.tree] Error 1 (ignored)
make[3]: [mono-tools.tree] Error 1 (ignored)
make[3]: [monoapi.tree] Error 1 (ignored)