SFML community forums
Bindings - other languages => DotNet => Topic started by: vsnmrs on October 09, 2014, 05:47:36 pm
-
Hello
I get this error when I try to run this code
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using SFML;using SFML.Window;using SFML.Graphics;namespace ForeverNight
{ public class Game
{ private static void OnClose
(object sender, EventArgs e
) { RenderWindow window
= (RenderWindow
)sender
; window
.Close(); } static void Main
() { RenderWindow window
= new RenderWindow
(new VideoMode
(800,
600),
"ForeverNight"); window
.Closed += new EventHandler
(OnClose
); Color backgroundColor
= new Color
(0,
192,
255); while(window
.IsOpen()) { window
.DispatchEvents(); window
.Clear(backgroundColor
); window
.Display(); } } }}
Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'csfml-wind
ow-2': The specified module could not be found. (Exception from HRESULT: 0x80070
07E)
at SFML.Window.Window.sfWindow_createFromHandle(IntPtr Handle, ContextSetting
s& Params)
at SFML.Graphics.RenderWindow..ctor(VideoMode mode, String title, Styles styl
e, ContextSettings settings)
at SFML.Graphics.RenderWindow..ctor(VideoMode mode, String title)
at ForeverNight.Game.Main() in f:\ForeverNight Project\ForeverNight\ForeverNi
ght\Game.cs:line 23
Press any key to continue . . .
I had used both version of sfml (2.0 and 2.1) with Visual Studio Express 2013 and getting the same error
-
Did you even try to read and understand the error message? It says exactly what is wrong.
: System.DllNotFoundException: Unable to load DLL 'csfml-wind
ow-2':
You must have the CSFML dlls in the working directory of your application...
-
Of course I have read the error. Anyway, I have found the problem; previously I've added the dll's in a separate folder in my solution. Now I've moved them in the root directory and it's working.
Thanks.