SFML community forums
Help => General => Topic started by: the_composer on March 05, 2013, 12:22:28 am
-
I'm trying to get set up with SFML in Code Blocks on Windows 7. I'm currently following the official tutorial (http://www.sfml-dev.org/tutorials/2.0/start-cb.php) but running into some problems.
Following the guide, I have my linker settings as below:
Image (http://i.imgur.com/7jTSf6z.png)
However, as you can see, when I build my project, I get errors of the type: "cannot find -lsfml-graphics-s-d".
However, if I select the .a files from the file browser using the Add library button, my settings look like this:
Image (http://i.imgur.com/xQ9w54m.png)
Note the different set of errors.
I have my search directory set up correctly:
Image (http://i.imgur.com/blfPsYz.png)
And that is directory where I unpacked the library.
So... what am I doing wrong?
-
I'm not sure if that will solve the problem, but you shouldn't work in the Program Files directory, since it kinda requires admin rights to change stuff in there and maybe code::blocks doesn't get the rights to 'search' the directory for SFML and just errors our with 'not found'.
I usually work with a second partition, that holds all my data files and got for some additional development tools a directory C:\Dev\ but anythings outside of Program Files should work fine. ;)
-
I moved SFML out of Program Files (now in C:\Dev\), and I'm still getting the same errors.
-
Try setting the search path in the project settings, rather than the Debug mode settings.
Also does it work if you specify libsfml-graphics-s-d or libsfml-graphics-s-d.a?
I assume you're using the MinGW version that came with Code:Blocks 12.11, right?
-
The search path is set in all three (SFML Test, Debug, and Release).
Both libsfml-graphics-s-d and libsfml-graphics-s-d.a produce the same error as sfml-graphics-s-d.
And yes, CB 12.11 with MinGW g++ compiler.
-
Actually no, I got the compiler from here (http://www.equation.com/servlet/equation.cmd?fa=fortran). I got the 1/13/2013 weekly snapshot for gcc 4.8 and 64-bit Windows.
-
Update: So I downloaded and set up MinGW in CodeBlocks, and now I'm looking at a different set of errors:
(http://i.imgur.com/2R5rPii.png)
Any ideas?
-
These are my settings for codeblocks:
http://en.sfml-dev.org/forums/index.php?topic=10366.msg71355#msg71355
It may have to do with your mingw not synching up w/ your SFML build -- match up your install to exploiters nightly builds. I think if you grab mingw/code blocks pair off of the codeblocks main site it installs gcc 4.7.1 tdm
-
Actually no, I got the compiler from here (http://www.equation.com/servlet/equation.cmd?fa=fortran). I got the 1/13/2013 weekly snapshot for gcc 4.8 and 64-bit Windows.
GCC 4.8 is still in development and thus undstable. I'd strongly advise against the useage of unstable compilers.
Any ideas?
Your compiler isn't compatible with your SFML version. You need to rebuild SFML.
-
Actually no, I got the compiler from here (http://www.equation.com/servlet/equation.cmd?fa=fortran). I got the 1/13/2013 weekly snapshot for gcc 4.8 and 64-bit Windows.
GCC 4.8 is still in development and thus undstable. I'd strongly advise against the useage of unstable compilers.
Any ideas?
Your compiler isn't compatible with your SFML version. You need to rebuild SFML.
I believe you missed the part where I downloaded the latest version of MinGW and set that up in Code Blocks instead of the 4.8 compiler. The image above shows the errors I'm getting.
-
My second comment quoted your last message. ;)
The errors mean, that your compiler isn't compatible with your SFML version, you need to rebuild SFML.
-
Whoops, sorry. Just woke up and the brain's not quite clicking yet. Thanks for your help!
-
So I followed the guide here (http://www.sfml-dev.org/tutorials/2.0/compile-with-cmake.php), but when building I get the error: gcc\bin\ar.exe: *.o: Invalid argument
Image (http://i.imgur.com/9g9jvvR.png)
ar.exe is set as the Linker for static libs in the toolchain executables. What's wrong here, and how can I fix it?