Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Unable to load Dll's  (Read 3071 times)

0 Members and 2 Guests are viewing this topic.

vsnmrs

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Unable to load Dll's
« 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

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Unable to load Dll's
« Reply #1 on: October 09, 2014, 09:08:16 pm »
Did you even try to read and understand the error message? It says exactly what is wrong.

Quote
: System.DllNotFoundException: Unable to load DLL 'csfml-wind
ow-2':

You must have the CSFML dlls in the working directory of your application...
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

vsnmrs

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Unable to load Dll's
« Reply #2 on: October 10, 2014, 08:54:36 am »
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.

 

anything