问题描述
因此,我尝试使用silk.net
和.net core 3.1
做一些OpenGl。当我尝试将nativeptr<int>
转换为voidptr
时,出现奇怪的错误。
下面是重现错误的最小示例。
#nowarn "9"
open FSharp.NativeInterop
[<EntryPoint>]
let main argv =
let numbers = [| 1..10 |]
use v = fixed numbers
let v' = NativePtr.toVoidPtr v
printfn "void = %A" v'
0 // return an integer exit code
此代码在运行时生成:
$ dotnet run
Unhandled exception. System.TypeLoadException: The generic type 'Microsoft.FSharp.Core.FSharpFunc`2' was used with an invalid instantiation in assembly 'FSharp.Core,Version=4.7.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a'.
at Program.main(String[] argv)
我在做什么错了?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)