如何在Mac OS上运行简单的f#程序

 樱花恋雪的玫瑰_484 发布于 2022-12-09 12:12

我已经安装了Xamarin来学习F#并编写一个简单的程序:

[]
let main args = 
    printfn "%d" 10
    0

如果我从Xamarin Studio启动它,一切正常.但是,如果我尝试编译并从控制台运行它我得到错误:

$ fsharpc some.fs
F# Compiler for F# 3.1 (Open Source Edition)
Freely distributed under the Apache 2.0 Open Source License

# demas at MacBook-Air-demas.local in ~/temporary [17:47:22]
$ ./some.exe
zsh: exec format error: ./some.exe

我该如何解决?

1 个回答
  • 尝试:

    mono some.exe
    

    或者使用完整路径:

    /usr/bin/mono ./some.exe
    

    http://www.mono-project.com/archived/guiderunning_mono_applications/

    2022-12-11 02:10 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有