SFML community forums

Help => General => Topic started by: excentio on January 11, 2015, 04:06:12 am

Title: NetBeans problem
Post by: excentio on January 11, 2015, 04:06:12 am
Hello guys, I have a problem with setting up SFML and NetBeans with minGW compiler. Looks like I connected all correctly, I'm using SFML 2.2 build for MinGW - 32bit
(http://i.imgur.com/83mvQLB.png)
(http://i.imgur.com/BfJ9fbs.png)
(http://i.imgur.com/awZyPMK.png)
(http://i.imgur.com/iJ9C5v3.png)

I'm trying to compile this simple code :
#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;
}

and I get this error
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Release.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/d/NetBeansProj/SFML_ENGINE'
"/C/MinGW/msys/1.0/bin/make.exe"  -f nbproject/Makefile-Release.mk dist/Release/MinGW-Windows/sfml_engine.exe
make.exe[2]: Entering directory `/d/NetBeansProj/SFML_ENGINE'
mkdir -p build/Release/MinGW-Windows
rm -f "build/Release/MinGW-Windows/main.o.d"
g++    -c -O2 -DSFML_STATIC -I../../SFML-2.2/include -std=c++11 -MMD -MP -MF "build/Release/MinGW-Windows/main.o.d" -o build/Release/MinGW-Windows/main.o main.cpp
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\cmath:44:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\random:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:65,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62,
                 from ../../SFML-2.2/include/SFML/System/Utf.hpp:32,
                 from ../../SFML-2.2/include/SFML/System/String.hpp:32,
                 from ../../SFML-2.2/include/SFML/System.hpp:39,
                 from ../../SFML-2.2/include/SFML/Window.hpp:32,
                 from ../../SFML-2.2/include/SFML/Graphics.hpp:32,
                 from main.cpp:1:
c:\mingw\include\math.h: In function 'float hypotf(float, float)':
c:\mingw\include\math.h:635:30: error: '_hypot' was not declared in this scope
 { return (float)(_hypot (x, y)); }
                              ^
make.exe[2]: *** [build/Release/MinGW-Windows/main.o] Error 1
make.exe[2]: Leaving directory `/d/NetBeansProj/SFML_ENGINE'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/d/NetBeansProj/SFML_ENGINE'
make.exe": *** [.build-impl] Error 2
 
BUILD FAILED (exit value 2, total time: 1s)

tried reinstalling minGW twice and tried googling, but no result, that's why I'm here
Title: AW: NetBeans problem
Post by: eXpl0it3r on January 11, 2015, 12:43:22 pm
What MinGW file did you download and install?
What exact SFML package did you download?
Title: Re: AW: NetBeans problem
Post by: excentio on January 11, 2015, 04:25:25 pm
What MinGW file did you download and install?
What exact SFML package did you download?

this is MinGW file which I downloaded and installedhttp://www.mingw.org/ (http://www.mingw.org/)
and this is the SFML package which I downloaded (http://imghost.in/img/2015-01/11/mvdyw16zgprpapv6qrp7i1e4i.png)
Title: Re: NetBeans problem
Post by: eXpl0it3r on January 11, 2015, 05:21:34 pm
The compiler version of the SFML package and your compiler version have to fully match. The SFML package you download has been compiled with this compiler (http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/4.9.2/threads-posix/dwarf/i686-4.9.2-release-posix-dwarf-rt_v3-rev0.7z/download).