Hello. I'm having some issues trying out SFML.NET. I'm not exactly sure how I'm supposed to compile an F# example manually? I don't use IDEs so I just make batch files, and, I can't seem to get this to work.
I'm getting a runtime exception that says "sfmlnet-window-2 or one of it's dependencies can't be loaded. An attempt was made to load an incorrect format". The example compiles, and it doesn't complain about any other assembly. Just that one.
I don't currently have a config file for my executable or anything, just kind of rawdogging it for now until I actually know how to use SFML from F#. So I put the four sfmlnet-*-2.dll files in the same directory as my executable, as well as all the other binaries (csfml-system-2.dll, etc.) in the same directory as well. I've already tried the precompiled "Window" example that comes with SFML.NET in the same directory, and it runs. So I don't know what's going wrong here.
This is the command I'm using:
fsc.exe test1.fs -I E:\PROJ\F_Sharp\SFML.Net-2.2\test -r sfmlnet-system-2.dll -r sfmlnet-audio-2.dll -r sfmlnet-graphics-2.dll -r sfmlnet-window-2.dll
And my code is:
namespace FSWindow
open
Systemopen SFML
open SFML
.Graphicsopen SFML
.Windowopen SFML
.Systemmodule Window
= [<EntryPoint
>] let main argv
= use mainWindow
= new RenderWindow
(VideoMode
(600u, 600u
),
"EmptySpace") mainWindow
.SetFramerateLimit(40u
); mainWindow
.Closed.AddHandler(fun sender args
-> (sender
:?> RenderWindow
).Close()) let rec mainLoop
() = mainWindow
.DispatchEvents() mainWindow
.Display() match mainWindow
.IsOpen with
| true -> mainLoop
() |> ignore
| false -> () mainLoop
() 0