我试图将我在archlinux上的单开发应用程序捆绑在一起。
一旦我在单开发环境中构建了应用程序,我就会使用以下命令构建一个包:
mkbundle --deps file.exe --static但产出如下:
OS is: Linux
Note that statically linking the LGPL Mono runtime has more licensing restrictions than dynamically linking.
See http://www.mono-project.com/Licensing for details on licensing.
Sources: 1 Auto-dependencies: True
embedding: /home/test/Test/Test/bin/Release/file.exe
embedding: /usr/lib/mono/gac/gtk-sharp/2.12.0.0__35e10195dab3c99f/gtk-sharp.dll
config from: /usr/lib/mono/gac/gtk-sharp/2.12.0.0__35e10195dab3c99f/gtk-sharp.dll.config
embedding: /usr/lib/mono/4.5/mscorlib.dll
embedding: /usr/lib/mono/gac/gdk-sharp/2.12.0.0__35e10195dab3c99f/gdk-sharp.dll
config from: /usr/lib/mono/gac/gdk-sharp/2.12.0.0__35e10195dab3c99f/gdk-sharp.dll.config
embedding: /usr/lib/mono/gac/glib-sharp/2.12.0.0__35e10195dab3c99f/glib-sharp.dll
config from: /usr/lib/mono/gac/glib-sharp/2.12.0.0__35e10195dab3c99f/glib-sharp.dll.config
embedding: /usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll
embedding: /usr/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll
embedding: /usr/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
embedding: /usr/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll
embedding: /usr/lib/mono/gac/System.Security/4.0.0.0__b03f5f7f11d50a3a/System.Security.dll
embedding: /usr/lib/mono/gac/Mono.Cairo/4.0.0.0__0738eb9f132ed756/Mono.Cairo.dll
embedding: /usr/lib/mono/gac/pango-sharp/2.12.0.0__35e10195dab3c99f/pango-sharp.dll
config from: /usr/lib/mono/gac/pango-sharp/2.12.0.0__35e10195dab3c99f/pango-sharp.dll.config
embedding: /usr/lib/mono/gac/atk-sharp/2.12.0.0__35e10195dab3c99f/atk-sharp.dll
config from: /usr/lib/mono/gac/atk-sharp/2.12.0.0__35e10195dab3c99f/atk-sharp.dll.config
embedding: /usr/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/Mono.Posix.dll
Compiling:
AS = as (default)
as -o temp.o temp.s
as -o temp.o temp.s
Unhandled Exception:
System.ComponentModel.Win32Exception: ApplicationName='cmd', CommandLine='/c "as -o temp.o temp.s "', CurrentDirectory='', Native error= Cannot find the specified file
at System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) <0x40c2f420 + 0x00637> in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.ComponentModel.Win32Exception: ApplicationName='cmd', CommandLine='/c "as -o temp.o temp.s "', CurrentDirectory='', Native error= Cannot find the specified file
at System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) <0x40c2f420 + 0x00637> in <filename unknown>:0由于我是静态链接mono,所以我必须从AUR中安装mono,以确保我有静态库。
我也不知道为什么它有两个as -o temp.o temp.s列出。
任何帮助都将不胜感激。
编辑23NOV:我刚刚重新确认,as和cc已经安装。版本输出位于:http://pastebin.com/ka25tjWZ
编辑24NOV:正如被接受的答案中所解释的那样;我的mono没有被正确编译。我用下面的PKGBUILD使用abs进行了重新构建,它现在正在按预期工作。
# $Id: PKGBUILD 246414 2015-09-16 21:25:15Z daniel $
# Maintainer: Daniel Isenmann <daniel@archlinux.org>
# Contributor: Brice Carpentier <brice@dlfp.org>
pkgname=mono
pkgver=4.0.4.1
_pkgver=4.0.4
pkgrel=1
pkgdesc="Free implementation of the .NET platform including runtime and compiler"
arch=(i686 x86_64)
license=('GPL' 'LGPL2.1' 'MPL' 'custom:MITX11')
url="http://www.mono-project.com/"
depends=('zlib' 'libgdiplus>=3.8' 'sh' 'python' 'ca-certificates')
options=('!makeflags' 'staticlibs')
provides=('monodoc')
conflicts=('monodoc')
source=(http://download.mono-project.com/sources/mono/${pkgname}-${pkgver}.tar.bz2
mono.binfmt.d
sgen_fix.patch
build_fix.patch
Microsoft.Portable.Common.targets
fix-zlib-helper.patch)
md5sums=('f598b60a664dfebb1a5eef3e66a9a178'
'b9ef8a65fea497acf176cca16c1e2402'
'8a700b94bff7a913f920e95890d2fb4c'
'30a5af1a4ff50b98f9e73cc2ae554115'
'acbffadb0ac233c494b40dd5e79209a5'
'62912ad289535bf841c140727e5c1165')
install="${pkgname}.install"
build() {
cd "${srcdir}"/${pkgname}-${_pkgver}
# build mono
./configure --prefix=/usr \
--sysconfdir=/etc \
--bindir=/usr/bin \
--sbindir=/usr/bin \
--disable-quiet-build \
--disable-system-aot \
--enable-static \
--with-static_mono=yes \
--with-mcs-docs=no
make
# build jay
cd "${srcdir}"/${pkgname}-${_pkgver}/mcs/jay
make
}
package() {
cd "${srcdir}"/${pkgname}-${_pkgver}
make DESTDIR="${pkgdir}" install
# install jay
pushd "${srcdir}"/${pkgname}-${_pkgver}/mcs/jay
make DESTDIR="${pkgdir}" prefix=/usr INSTALL=../../install-sh install
popd
# install binfmt conf file and pathes
install -D -m644 "${srcdir}"/mono.binfmt.d "${pkgdir}"/usr/lib/binfmt.d/mono.conf
#install license
mkdir -p "${pkgdir}"/usr/share/licenses/${pkgname}
install -m644 mcs/MIT.X11 "${pkgdir}"/usr/share/licenses/${pkgname}/
#fix .pc file to be able to request mono on what it depends, fixes #go-oo build
sed -i -e "s:#Requires:Requires:" "${pkgdir}"/usr/lib/pkgconfig/mono.pc
}发布于 2015-11-23 11:48:03
更新:
因此,我认为朋友的ArchLinux和mkbundle在那里运行得很好,所以我回到了您的错误:
System.ComponentModel.Win32Exception: ApplicationName='cmd',CommandLine='/c“作为-o tem.o tem.s”,CurrentDirectory='',本机error=无法在System.Diagnostics.Process.Start_noshell找到指定的文件
因为这个错误,我原本以为你在Windows上,但是你说了Linux,所以我忽略了它。我去了mkbundle的源代码,我可以看到您的ArchLinux框和/或Mono安装没有正确地将'IsUnix‘报告为false,因此它没有通过system调用执行as cmd,而是试图使用cmd来执行它,因此失败了.
static bool IsUnix {
get {
int p = (int) Environment.OSVersion.Platform;
return ((p == 4) || (p == 128) || (p == 6));
}
}
static void Execute (string cmdLine)
{
if (IsUnix) {
Console.WriteLine (cmdLine);
int ret = system (cmdLine);
if (ret != 0)
{同样,我可以访问的ArchLinux 4.2.5-1有Mono4.0.4.1并且按预期工作.
您的系统中每一行返回什么?:
int p = (int) Environment.OSVersion.Platform;
var islinux = ((p == 4) || (p == 128) || (p == 6));原版:
环境变量 作为汇编程序命令。默认为"as“。CC编译器命令。默认为Linux下的"cc“,Windows下的"gcc”。
参考文献:man mkbundle
这与构建mono本身所需的要求相同,除了temp.s汇编程序代码之外,它还将创建需要c++编译器的temp.c文件。这是加载/执行基于CIL的代码的引导代码。
如果您在系统中缺少一个汇编程序,那么就会有许多包,比如binutils,它们将满足需求。
https://stackoverflow.com/questions/33863332
复制相似问题