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

Author Topic: SFML compile error  (Read 4195 times)

0 Members and 1 Guest are viewing this topic.

Davidsen

  • Newbie
  • *
  • Posts: 3
    • View Profile
SFML compile error
« on: December 27, 2009, 07:40:27 pm »
I've been trying to debug and run this piece of code

Code: [Select]

#include <SFML/System.hpp>
#include <iostream>

int main()
{
    sf::Clock Clock;
    while (Clock.GetElapsedTime() < 5.f)
    {
        std::cout << Clock.GetElapsedTime() << std::endl;
        sf::Sleep(0.5f);
    }

    return 0;
}

but i always get an error, i've done everything that was needed to be done in this tutorial: http://www.sfml-dev.org/tutorials/1.5/start-vc.php

1>------ Build started: Project: SFML, Configuration: Debug Win32 ------

1>Linking...

1>sfml-system.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x2A8

1>Build log was saved at "file://c:\Users\Miki Davidsen\Dokumenter\Visual Studio 2008\Projects\SFML\SFML\Debug\BuildLog.htm"

1>SFML - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Is it the sfml-system.dll that is invalid or corrupt?

Davidsen

  • Newbie
  • *
  • Posts: 3
    • View Profile
SFML compile error
« Reply #1 on: December 27, 2009, 07:47:30 pm »
Nevermind, i fixed the error, it was a problem with Linker/Input/Additional Dependencies


But how do i compile the Actual SFML?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML compile error
« Reply #2 on: December 27, 2009, 07:53:57 pm »
Quote
But how do i compile the Actual SFML?

What do you mean?
Laurent Gomila - SFML developer

Davidsen

  • Newbie
  • *
  • Posts: 3
    • View Profile
SFML compile error
« Reply #3 on: December 27, 2009, 07:58:55 pm »
I've been trying to debug SFML using sfml.sln as stated in the tutorial, but an error always appears saying i need the SFML.exe in same directory as sfml.sln.
So i added the sfml.exe to the same directory, and it debugs, and runs the .exe file but all it does is count the elapsed time.

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Re: SFML compile error
« Reply #4 on: December 27, 2009, 08:46:31 pm »
Quote from: "Davidsen"
I've been trying to debug SFML using sfml.sln as stated in the tutorial, but an error always appears saying i need the SFML.exe in same directory as sfml.sln.
So i added the sfml.exe to the same directory, and it debugs, and runs the .exe file but all it does is count the elapsed time.
Because that's what you told it to do in your code.
Also, add -d to the end of each dependency, so it is like this "sfml-system-d.lib" instead of "sfml-system.lib"
That will give you the debug SFML.
I use the latest build of SFML2