【发布时间】:2013-10-01 13:10:48
【问题描述】:
我正在尝试通过盈透证券的 C# API 连接。 作为练习,我正在尝试在 F# 中开发我的客户端。
这就是我所做的:
- 我已经在 Visual Studio 中导入了 CSharpAPI 项目。 CSharpAPI 定义了 IBApi 命名空间
- 我在解决方案中创建了一个新的 F# 项目。该项目将主持我的实施
-
我在 .fs 文件中创建了一个新模块,如下所示:
open IBApi module ibConnectivity = type IBclient = interface EWrapper with member this.connectionClosed() = printfn "connection has been closed" member this.currentTime time = printfn "server time: %i" time ....
我收到以下错误消息:
错误 1 库或多文件应用程序中的文件必须开始 带有命名空间或模块声明,例如'命名空间 SomeNamespace.SubNamespace' 或 'module SomeNamespace.SomeModule'
我已经用谷歌搜索了一个解决方案。我是一个完整的菜鸟。 有些帖子提到了 F# 文件顺序,但在这种情况下,我正在使用 C# 库。
【问题讨论】: