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

Author Topic: Simple problem setting up SFML with c::b  (Read 2031 times)

0 Members and 1 Guest are viewing this topic.

Canite

  • Newbie
  • *
  • Posts: 3
    • View Profile
Simple problem setting up SFML with c::b
« on: March 20, 2011, 08:02:30 pm »
I'm sure you guys get a lot of questions like this, but I have searched and have not been able to find an answer.  Also please note that I'm very new to this.
I'm following the tutorials and have run into problems on the very first example 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;
}

In debug, it returns "SFML/System.hpp: No such file or directory" and the rest of the errors are just "sf has not been declared", etc.  
I have followed the tutorial exactly as it is stated, and I chose to go with copying the files into the include and lib folders of c::b.  My include directory looks like this:

And I copied all of the *.a files from SFML into the lib folder of c::b.
I then went to the project's build options and put:

The part in the Link Libraries: section is not in the tutorial, but from reading previous posts about this kind of stuff, I thought it is what I was supposed to do.  But it gives the same error without that part.
I'm on windows XP with code::blocks-10.05.
Any help is greatly appreciated, and go easy on me, I'm a noob ;)

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Simple problem setting up SFML with c::b
« Reply #1 on: March 21, 2011, 10:18:48 am »
Just a wild guess, but I think you specified "SFML_PATH/include/SFML/" as your include path. It must be "SFML_PATH/include/" (where SFML_PATH is -- actually! -- the path to your SFML installation ;)).

Btw.: Compilers complaining about not finding headers has nothing to do with the linker.

Canite

  • Newbie
  • *
  • Posts: 3
    • View Profile
Simple problem setting up SFML with c::b
« Reply #2 on: March 22, 2011, 03:01:48 am »
Quote
Just a wild guess, but I think you specified "SFML_PATH/include/SFML/" as your include path. It must be "SFML_PATH/include/" (where SFML_PATH is -- actually! -- the path to your SFML installation ).

Well, no, I had copied all the files to the correct directories as the first option in the tutorial said, but I also tried by specifying the include path to my SFML installation, and now the window comes up, but it says
"This application has failed to start because sfml-system.dll was not found. Re-installing the application may fix this problem."  So I'm stumped  :?

Quote
Btw.: Compilers complaining about not finding headers has nothing to do with the linker.

Noted. ;)

Svenstaro

  • Full Member
  • ***
  • Posts: 222
    • View Profile
Simple problem setting up SFML with c::b
« Reply #3 on: March 22, 2011, 04:09:47 am »
Put your dlls where your exe is.

Canite

  • Newbie
  • *
  • Posts: 3
    • View Profile
Simple problem setting up SFML with c::b
« Reply #4 on: March 22, 2011, 05:47:34 am »
Quote
Put your dlls where your exe is.

edit: Ok, the dll is in there. I'm finally understanding this.. Now I just need to find libgcc_s_dw2.dll file.. Thank you.
edit again: And, I can't find that file anywhere.. Why does it need this dll?
edit for a third time..: After doing some research, it appears that I have the SJLJ version of gcc and SFML uses the Dwarf2 version (dw2).  I was able to download a copy of the dll and got it working, but in a previous post here asking about this question, Laurent said to not mix the two different versions.  Should I get the other version of gcc, and if so, where do I download it?

 

anything