• Install/Compile problem with SFML and Codeblocks.
    13 replies, posted
Hello guys, I recently read a thread on here that says Sfml is a good place to start game developing but it will not install. I followed the tutorial here: [url]http://www.sfml-dev.org/tutorials/1.6/start-cb.php[/url] However I believe is it not working. The example code on the site should work once I have followed the installation steps instead I get these errors: [code]reference to `sf::Clock::Clock()'| obj\Debug\main.o(.text+0x13c):C:\Users\Rob\Desktop\CodeBlocks\Everything\main.cpp|7|undefined reference to `sf::Clock::GetElapsedTime() const'| obj\Debug\main.o(.text+0x156):C:\Users\Rob\Desktop\CodeBlocks\Everything\main.cpp|9|undefined reference to `sf::Clock::GetElapsedTime() const'| obj\Debug\main.o(.text+0x183):C:\Users\Rob\Desktop\CodeBlocks\Everything\main.cpp|10|undefined reference to `sf::Sleep(float)'| ||=== Build finished: 4 errors, 0 warnings ===| [/code] Sorry if they are difficult to read. I have no idea why I am getting these errors though. I followed everything correctly. Also my linker defined is as follows: [code] -lsfml-audio -lsfml-graphics -lsfml-window -lsfml-system [/code] I believe that to be correct as well. Anybody else know what is going on here? Any help would be appreciated. Thanks in advance.
You're linking to the release libs when you're in fact compiling using a debug build. you can fix it simply by switching to a release build or link to these libs [code] -lsfml-audio-d -lsfml-graphics-d -lsfml-window-d -lsfml-system-d [/code]
Belter. Now I am getting an error that "-lsfml-system-d" is missing from my computer. I'll find a way to fix that though, thanks again.
When running the executable? You need to place the .so or .dll files in the same folder as your executable or link with the static libraries.
[QUOTE=RobMckenzie;26667849]Belter. Now I am getting an error that "-lsfml-system-d" is missing from my computer. I'll find a way to fix that though, thanks again.[/QUOTE] Put the dlls you found in the /lib/ folder when you downloaded sfml in the same folder as the executable.
Yeah, I did all that and now I am missing another .dll file. Which is nowhere in the SFML-1.6 folder. "The program can't start because libgcc_2_dw2-1.dll is missing from your computer." Any suggestions?
bah code blocks. I suggest using vc++2008 express
VC++2008 express also requires its own runtime. Look in your MinGW folder, that dll should be in there.
As an alternative to putting that DLL into the folder, you can also statically link it by adding -static-libgcc to your linker options.
Still can't find it. Doesn't seem to be present, I tried linking the library but that still didn't work.
In a default installation of MinGW, the libgcc_s_dw2-1.dll file is located in C:\MinGW\bin. [url=http://www.sfml-dev.org/tutorials/mingw-with-gcc-4.4.zip]Here[/url] is the MinGW files with GCC 4.4 (and libgcc_s_dw2-1.dll) arranged by the maker of SFML, Laurent. As a side note, it's stated [url=http://www.sfml-dev.org/tutorials/1.6/start-cb.php]here[/url] that you need GCC 4.4 or higher to compile SFML 1.6.
[QUOTE=ZeekyHBomb;26669879]VC++2008 express also requires its own runtime.[/QUOTE] Unless you link with it statically... the executables are huge then, though.
It still requires its own runtime, it's just compiled into the executable, which is also possible with g++.
[QUOTE=WiZzArD;26679024]In a default installation of MinGW, the libgcc_s_dw2-1.dll file is located in C:\MinGW\bin. [url=http://www.sfml-dev.org/tutorials/mingw-with-gcc-4.4.zip]Here[/url] is the MinGW files with GCC 4.4 (and libgcc_s_dw2-1.dll) arranged by the maker of SFML, Laurent. As a side note, it's stated [url=http://www.sfml-dev.org/tutorials/1.6/start-cb.php]here[/url] that you need GCC 4.4 or higher to compile SFML 1.6.[/QUOTE] Thanks alot you fixed my problem. :D
Sorry, you need to Log In to post a reply to this thread.