- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我已经做了几天了,虽然我很快就设法让 Mono 的 mkbundle 在 Windows 和 Linux 上创建一个本地可执行文件,但我无法在 OS X 上做同样的事情。
我正在使用 Mono 3.4.0,因为我需要 .NET 4.5 支持,并且能够在 OS X 上针对 x86_64 进行编译也很好。
我目前使用以下简单的 bash 脚本来尝试构建 mkbundle:
#!/bin/bash
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/pkgconfig:/Library/Frameworks/Mono.framework/Versions/3.4.0/lib/pkgconfig
#PKG_CONFIG_PATH=/Library/Frameworks/Mono.framework/Versions/3.4.0/lib/pkgconfig
mkbundle bin/Release/Launcher.exe --static --deps -o bin/Release/OSXNative/Launcher.exe
我得到以下输出:
$ ./OSXNativeBuild.sh
OS is: Darwin
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: /Volumes/app/Launcher/Launcher/bin/Release/Launcher.exe
embedding: /Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll
embedding: /Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/4.5/mscorlib.dll
embedding: /Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll
embedding: /Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
embedding: /Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll
embedding: /Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/gac/System.Security/4.0.0.0__b03f5f7f11d50a3a/System.Security.dll
embedding: /Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/gac/System.Windows.Forms/4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
embedding: /Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/gac/System.Drawing/4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
embedding: /Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/gac/Mono.WebBrowser/4.0.0.0__0738eb9f132ed756/Mono.WebBrowser.dll
embedding: /Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/Mono.Posix.dll
embedding: /Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/gac/System.Runtime.Serialization.Formatters.Soap/4.0.0.0__b03f5f7f11d50a3a/System.Runtime.Serialization.Formatters.Soap.dll
embedding: /Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/gac/Accessibility/4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
embedding: /Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/gac/System.Data/4.0.0.0__b77a5c561934e089/System.Data.dll
embedding: /Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/gac/Mono.Data.Tds/4.0.0.0__0738eb9f132ed756/Mono.Data.Tds.dll
embedding: /Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/gac/System.Transactions/4.0.0.0__b77a5c561934e089/System.Transactions.dll
embedding: /Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/gac/System.EnterpriseServices/4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
Compiling:
as -o temp.o temp.s
cc -o bin/Release/OSXNative/Launcher.exe -Wall `pkg-config --cflags mono-2` temp.c `pkg-config --libs-only-L mono-2` `pkg-config --variable=libdir mono-2`/libmono-2.0.a `pkg-config --libs-only-l mono-2 | sed -e "s/\-lmono-2.0 //"` temp.o
ld: warning: ignoring file /Library/Frameworks/Mono.framework/Versions/3.4.0/lib/pkgconfig/../../lib/libmono-2.0.a, file was built for archive which is not the architecture being linked (x86_64): /Library/Frameworks/Mono.framework/Versions/3.4.0/lib/pkgconfig/../../lib/libmono-2.0.a
Undefined symbols for architecture x86_64:
"_mono_main", referenced from:
_main in temp-I71V1m.o
"_mono_register_bundled_assemblies", referenced from:
_mono_mkbundle_init in temp-I71V1m.o
"_mono_set_dirs", referenced from:
_main in temp-I71V1m.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ERROR: [Fail]
我尝试过的事情:
最佳答案
我最终弄清楚了问题所在 - 我看到遇到了新的 mkbundle 属性要求和一些不匹配的架构设置。以下脚本对我有用:
#!/bin/bash
# Notes:
# You will need the Mono SDK 3.x series as the 2.x SDK cannot build for 64bit architectures.
# It appears that Mono 3.x still cannot compile for 64bit without having to manually compile Mono yourself.
# Since we don't strictly need 64bit support the below forces a 32bit build.
# Ensure it can find pkg-config:
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/pkgconfig:/Library/Frameworks/Mono.framework/Versions/3.4.0/lib/pkgconfig
# Force 32bit build and manually set some clang linker properties:
export AS="as -arch i386"
export CC="cc -arch i386 -lobjc -liconv -framework Foundation"
# Build:
mkbundle bin/Release/Launcher.exe --static --deps -o bin/Release/OSXNative/Launcher.exe
关于c# - Mkbundle 无法在 OS X 上编译 C# 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24361498/
我有一个 .Net 程序,使用“mono Program.exe”可以正常工作,但现在我尝试在同一台机器上使用“mkbundle -o prog Program.exe --deps”,它返回以下错误
我有一个 Windows 服务,想在 Linux 上使用 Mono 运行。我可以使用单一服务将其作为服务运行,并且效果很好。 我还想mkbundle该应用程序以简化最终用户的部署,这样他们就不需要自己
我正尝试在 Linux 上使用 Mono 为我的 .net 应用程序创建一个包。当我执行如下 mkbundle 命令时 - $>mkbundle -o ConsoleApp ConsoleApp.ex
我正在尝试使用 mono 的 mkbundle 创建一个独立的 C# 应用程序,我安装了 Xcode 和 Mono 开发工具包(我确定它是 MDK 而不是运行时)。但是我运行 mkbundle 使用m
我可以从我的 MonoDevelop C# 项目成功构建一个捆绑的 exe,但是当我运行 bundle 时,它什么也没做;执行会立即安静地终止。我做错了什么? 我在 64 位 Windows 7 上使
我正在尝试构建 this C# program使用 MkBundle 以便用户可以在 Linux 上运行它而无需安装 Mono。 但在尝试使用构建的程序时,我总是遇到错误。 重现步骤: Git 克隆这
我可以使用 mkbundle 命令构建一个包。之后,当我尝试在另一个未安装 Mono 的 Linux 系统中运行该应用程序时,该应用程序未执行且没有错误。 最佳答案 单独使用 Mkbundle 将构建
我正在使用 mkbundle 并尝试创建一个使用 Isis2 的小程序 IdaTester 的嵌入式版本。该系统反过来使用依赖于 MonoPosixHelper 的 Mono 特性 我的问题是 mkb
我写了一些控制台“Hello world”之类的应用程序。并已关注 c# cywgwin mono mkbundle windows 7 - cannot compile file回答。但我有: $
我正在尝试构建一个需要在可能未安装 .NET 的环境中运行的控制台实用程序。 Mono 的 mkbundle 似乎是解决这个问题的好方法,但是当通过 cygwin 在 Windows 10 上的一个小
我正在尝试将我在 archlinux 上的 monodevelop 中制作的应用程序捆绑在一起。 在 monodevelop 中构建应用程序后,我将使用以下命令打包: mkbundle --deps
已经有相当多的人提到了 Mono 实用程序 mkbundle,它应该(除其他外)允许您使用用 Mono 编译的 C# 项目创建一个包(独立的 .exe)。这在我在 Cygwin 中运行时有效,但是我真
Mono 生成的普通 EXE 在 IL 中。我想生成 native 可执行文件,使用 mkbundle 生成 native Exe 还是应该使用 Mono AOT。 最佳答案 是的,mkbundle
尝试为可在 Linux 上运行的控制台创建一个独立的应用程序,工作环境在 Mac os x 10.7 上。 1.) 打开 Monodevelop 并创建新的解决方案,一个“C# 控制台项目”。 2.)
我正在尝试按照以下帖子使用 cygwin 构建一个嵌入了单声道的 c# 应用程序。 我正在按照此处的指南进行操作:How to convert a simple .Net console projec
我有一个小型 C# 应用程序,我想将其转换为 native 可执行二进制文件。csc Foo.cs 运行时没有警告,我可以毫无问题地运行应用程序:mono Foo.exe。 然而,当我启动 mkbun
我是一名长期的 C# 开发人员,但不熟悉 Mono,尤其是 Gtk#。我使用 C# 和 Gtk# 开发了一个小应用程序。我需要这个应用程序在 Windows、Linux 和 Mac 上运行,所以我决定
我有一个示例 .NET 应用程序可以在 Windows 上正常运行,而我的 Ubuntu 环境则使用单声道。 我正在尝试使用 Mkbundle 创建单个 native 程序集,以便我可以使用 busy
我一直在尝试使用 mkbundle 编译或捆绑我的应用程序。这是我正在执行的脚本: set -o errexit set -o nounset mono_version="3.2.3" export
我想看看是否可以通过使用 Mono 的 AOT(提前编译器)来减少 VM 延迟。如何运行 .so 文件? (抱歉,这个问题太初级了;我在 Mono 的文档中找不到简单的答案)。 我想出了如何使用 mk
我是一名优秀的程序员,十分优秀!