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

Author Topic: SFML 2 problem  (Read 4501 times)

0 Members and 1 Guest are viewing this topic.

Richy19

  • Full Member
  • ***
  • Posts: 190
    • View Profile
SFML 2 problem
« on: April 20, 2011, 04:58:29 pm »
Hi im trying to use SFML with C# but when i try to run my program i get:

Could not load file or assembly 'sfmlnet-window-2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.

I built the DLL's myself if it matters

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML 2 problem
« Reply #1 on: April 20, 2011, 05:10:42 pm »
Is it located in the same directory as the executable, or in a path where the .Net framework can find it?
Laurent Gomila - SFML developer

Richy19

  • Full Member
  • ***
  • Posts: 190
    • View Profile
SFML 2 problem
« Reply #2 on: April 20, 2011, 05:38:20 pm »
Yea its in the same place as the .exe

Richy19

  • Full Member
  • ***
  • Posts: 190
    • View Profile
SFML 2 problem
« Reply #3 on: April 20, 2011, 05:59:26 pm »
Also this is the code i have
Code: [Select]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SFML.Audio;
using SFML.Window;
using SFML.Graphics;

namespace GameBase
{
    class main
    {
        static void OnClose(object sender, EventArgs e)
        {
            // Close the window when OnClose event is received
            RenderWindow window = (RenderWindow)sender;
            window.Close();
        }
        static RenderWindow app;

        static void Main(string[] args)
        {
            // Create the main window
            app = new RenderWindow(new VideoMode(800, 600), "SFML window");
            app.Closed += new EventHandler(OnClose);

            // Start the game loop
            while (app.IsOpened())
            {
                // Process events
            app.DispatchEvents();

            // Clear screen
            app.Clear();

            // Update the window
            app.Display();
            }
        }
    }
}



And this is how i have the CSFML DLL's set up

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML 2 problem
« Reply #4 on: April 20, 2011, 06:27:43 pm »
The error complains about sfmlnet DLLs, not csfml.
Laurent Gomila - SFML developer

Richy19

  • Full Member
  • ***
  • Posts: 190
    • View Profile
SFML 2 problem
« Reply #5 on: April 20, 2011, 07:20:03 pm »
Hmm It must be a problem with VS2010 or how I built it, I just downloaded the 1.6 version and it works fine

nonni

  • Newbie
  • *
  • Posts: 1
    • View Profile
SFML 2 problem
« Reply #6 on: February 20, 2012, 11:26:38 pm »
I'm having the same problem, Built it with VS2010 on Windows7 64bit.