macos - 在 Mac 上以 32 位模式运行交互式 F#

标签 macos winforms f# f#-interactive

当我在 Mac OS 上的 fsharpi 中时,我这样做了

open System.Windows.Forms;;
let f = new Form();;

我收到以下警告

WARNING: The Carbon driver has not been ported to 64bits, and very few parts of Windows.Forms will work properly, or at all

Fontconfig warning: ignoring UTF-8: not a valid region tag

Fontconfig warning: ignoring UTF-8: not a valid region tag

Fontconfig warning: ignoring UTF-8: not a valid region tag

Fontconfig warning: ignoring UTF-8: not a valid region tag

val f : Form = System.Windows.Forms.Form

事实上,没有任何效果。 有没有办法使用 32 位 Carbon 驱动程序?或者在 Mac 上运行使用 Windows 窗体的 F# 应用程序的另一种方式?

最佳答案

上周,我在 macOS 上通过 VS Code 在 FSI 中运行一些 Windows 窗体代码时遇到了这个问题。设置环境变量 MONO_ENV_OPTIONS=--arch=32 应该可以解决问题:

$ MONO_ENV_OPTIONS=--arch=32 fsharpi
Microsoft (R) F# Interactive version 4.1
Copyright (c) Microsoft Corporation. All Rights Reserved.

For help type #help;;

> open System.Windows.Forms;;
> let f = new Form();;
val f : Form = System.Windows.Forms.Form, Text:

关于macos - 在 Mac 上以 32 位模式运行交互式 F#,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49016487/

相关文章:

f# - 使用静态解析的类型参数链接中缀运算符

macos - 如何在 Mojave MacOS 上安装 gcc-arm-none-eabi

ruby-on-rails-3 - brew安装mongodb错误: Cowardly refusing to `sudo brew install' Mac OSX Lion

wpf - WPF/Winforms/ClickOnce/的统计使用情况

c# - (C#) 如何在 windows 窗体中制作暗模式主题(单独的窗体作为选择主题菜单)

types - F# Int * Int 混淆

swift - 合并 View 而不是单独显示它们

javascript - Mac 上的 Google Chrome 本地存储

c# - Winforms - 以线程安全方式更新属性的最简单方法是什么

c# - 如何在 C# 或 F# 中使用 Travis-CI