SFML community forums

Help => General => Topic started by: metulburr on November 15, 2013, 04:08:25 pm

Title: missing sfml-graphics-2.dll
Post by: metulburr on November 15, 2013, 04:08:25 pm
I get the error:
missing sfml-graphics-2.dll
when i try to compile SFML under windows. I walked through the tutorial.

Path to SFML
C:\SFML-2.1\

to confirm... in compiler settings for code blocks i changed:
compiler
C:\SFML-2.1\include

linker
C:\SFML-2.1\lib

settings->#defines
SFML_STATIC

linker settings:
sfml-graphics
sfml-window
sfml-system
sfml-network

enabled flag for c++11



windows 8
code blocks mingw
SFML 2.1


I think that was it. I don't really see a problem?
Title: Re: missing sfml-graphics-2.dll
Post by: G. on November 15, 2013, 04:23:58 pm
Quote from: http://www.sfml-dev.org/tutorials/2.1/start-cb.php
If you want to get rid of these DLLs and have SFML directly integrated to your executable, you must link to the static version. Static SFML libraries have the "-s" suffix: "sfml-xxx-s-d" for Debug, and "sfml-xxx-s" for Release.
Or if you want dynamic linking...:
Quote from: http://www.sfml-dev.org/tutorials/2.1/start-cb.php
if you linked to the dynamic version of SFML, don't forget to copy the SFML DLLs (they are in <sfml-install-path/bin>) to the directory where your compiled executable is.
Title: Re: missing sfml-graphics-2.dll
Post by: metulburr on November 15, 2013, 05:02:36 pm
changing to this however changed no results.
sfml-graphics-s
sfml-window-s
sfml-system-s
sfml-network-s
Title: Re: missing sfml-graphics-2.dll
Post by: wintertime on November 15, 2013, 05:08:52 pm
Are you compiling the Debug version in code::blocks while having only the Release version configured in the project? Debug version ends with "-d".
Be sure to check both build types in the tree view of the project build settings.
Title: Re: missing sfml-graphics-2.dll
Post by: metulburr on November 15, 2013, 05:17:48 pm
the projects build settings are identical to the compilers build settings
Title: Re: missing sfml-graphics-2.dll
Post by: wintertime on November 15, 2013, 05:29:29 pm
Settings menu->Compiler is not the same as project settings, its just a default and does not allow adding different library versions for debug and release. You should not put sfml libraries there.
Instead rightclick on the project name in the opened project tree and open the Build options. There is a small tree for global project settings, Debug settings and Release settings.
Title: Re: missing sfml-graphics-2.dll
Post by: metulburr on November 15, 2013, 05:34:28 pm
ok

Well the projects build options for both the Debug and Release are the same as the OP, with the addition of the -s suffixes
Title: Re: missing sfml-graphics-2.dll
Post by: wintertime on November 15, 2013, 05:43:02 pm
Then you may want to change the Debug options to include the "-d" and look if you put the others under Release and not in the tree root named after the project. ;)
Title: Re: missing sfml-graphics-2.dll
Post by: metulburr on November 15, 2013, 05:52:07 pm
ok so now in the tree:
project -> build options - > project_name has OP settings with no suffix
project -> build options - > project_name -> Debug has OP settings with -d suffix
project -> build options - > project_name -> Release has OP settings with -s suffix

but i still get the same error
Title: Re: missing sfml-graphics-2.dll
Post by: metulburr on November 15, 2013, 06:12:57 pm
EDIT:
sorry.... i didnt see the build target drop down box option to change from debug to release. Changing that stopped the original error.

However now i get 50 errors with the example code given:
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>


int main()
{
    sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
    sf::CircleShape shape(100.f);
    shape.setFillColor(sf::Color::Green);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();
        window.draw(shape);
        window.display();
    }

    return 0;
}
 

compiling:
mingw32-g++.exe -LC:\SFML-2.1\lib -LC:\SFML-2.1\lib -LC:\SFML-2.1\lib  -o bin\Release\test.exe obj\Release\main.o   -s  -lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio -lsfml-network -lsfml-graphics-s -lsfml-window-s -lsfml-system-s -lsfml-audio-s -lsfml-network-s

I am not sure if this is related to the changes i made to the projects links etc. i nthis thread or someething completely different at this point now.
Title: Re: missing sfml-graphics-2.dll
Post by: eXpl0it3r on November 15, 2013, 06:42:47 pm
Uhm why are you link the dynamic AND static libraries at the same time?
You should only link against on or the other. ;)
Title: Re: missing sfml-graphics-2.dll
Post by: metulburr on November 15, 2013, 08:24:14 pm
I thought the dynamic linking was just coping the dll's over to the directory with the executable, and that the -d suffix was for debug? How am i doing both?
Title: Re: missing sfml-graphics-2.dll
Post by: Nexus on November 15, 2013, 08:39:32 pm
You should (re-)read the official tutorial, everything is explained exactly.
Title: Re: missing sfml-graphics-2.dll
Post by: metulburr on November 15, 2013, 10:07:58 pm
I dont know where else to go as you point me to the tutorial in which in my perspective (at this point now) follows the tutorials to a T.  I've reread the tutorial again this time, but i dont see a difference in my setup as opposed to the tutorials.

It took me less than 60 seconds to install via linux, and in windows i have been messing around with it all day.
Title: Re: missing sfml-graphics-2.dll
Post by: Sqasher on November 15, 2013, 11:22:33 pm
If you want to link dynamically you link to sfml-graphics, sfml-window, sfml-system, sfml-audio, sfml-network and put the .dlls into the directory of the executable. For the debug version you link against the -d libs and put the -d.dll files into the directory.

If you want to link statically you only link to sfml-graphics-s, sfml-window-s, sfml-system-s, sfml-audio-s, sfml-network-s. For the debug version you link against the -d libs.

Don't mix static and dynamic linking.
Title: Re: missing sfml-graphics-2.dll
Post by: metulburr on November 16, 2013, 01:26:52 am
i dont really want to dynamically link the libs while learning SFML.
Title: Re: missing sfml-graphics-2.dll
Post by: Nexus on November 16, 2013, 09:48:17 am
It took me less than 60 seconds to install via linux, and in windows i have been messing around with it all day.
You could have saved that time if you had carefully read the installation tutorial...

i dont really want to dynamically link the libs while learning SFML.
Then link statically, where is the problem? Multiple people have stated what you need to link exactly.
Title: Re: missing sfml-graphics-2.dll
Post by: G. on November 16, 2013, 10:15:11 am
i dont really want to dynamically link the libs while learning SFML.
project -> build options - > project_name has OP settings with no suffix
Then don't do that.(http://i.imgur.com/QyJv6jZ.png)
However now i get 50 errors with the example code given
(http://village14.com/files/2013/03/threequestions.jpg)