SFML wont work with Code::Blocks >_<

Jan 19, 2011 at 10:54am
so i followed all the instuction:
SFML\include --> CodeBlocks\MINGW\include
SFML\lib --> CodeBlocks\MINGW\lib
Compiler and debugger menu, Global compiler settings / Search directories
added SFML\include
added SFML\lib
did the test code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#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;
}

then i went to Project Build options , linker setting:
1
2
3
-lsfml-graphics
-lsfml-window
-lsfml-system

and then i went to compiler settings , #define and added SFML_DYNAMIC
ran the program and got this:
1
2
3
4

Compiling: main.cpp
Execution of 'mingw32-g++.exe -Wall -fexceptions  -O2  -DSFML_DYNAMIC    -Iinclude -IC:\SFML\SFML-1.6\CSFML\include  -c "C:\Users\TheBreadCat\Documents\My Games\C\xxax\main.cpp" -o obj\Release\main.o' in 'C:\Users\TheBreadCat\Documents\My Games\C\xxax' failed.
Nothing to be done.

so what to do?
**edit ups wrong forum x_x
Last edited on Jan 19, 2011 at 10:55am
Jan 19, 2011 at 3:21pm
a few things make sure includes are under the compiler option and libs are included under the linker object. not both under compiler option. make sure these paths match where you put them. also you only need to add -lsfml-system command for this project. you dont need to define sfml_dynamic for this project if you follow their directions.

also you need the newer gcc compiler if your using the ming compiler that is default for code blocks. you can get it from the sfml page. i dont know if you did that part either. i followed the directs and all works for me. only problem i had was i had to drop a copy of sfml-system-d.dll into the projects debug bin directory where my debug exe resides.
Last edited on Jan 19, 2011 at 5:10pm
Topic archived. No new replies allowed.