当我在 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/