Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - skoda

Pages: [1]
1
Graphics / Re: SFML - Error creating a texture
« on: June 28, 2017, 12:09:27 pm »
Maybe the problem is with the compiler? I use GNU GCC Compiler

2
Graphics / Re: SFML - Error creating a texture
« on: June 28, 2017, 12:06:32 pm »
Thanks, but how to rebuild SFML? :)

3
Graphics / SFML - Error creating a texture
« on: June 28, 2017, 11:26:03 am »
Hi. I want to create a basic texture in SFML, Code::Blocks, but I am still receiving an extremly annoying and weird error:
Quote
C:\Users\user\Desktop\Wow\main.cpp|10|undefined reference to `sf::Texture::loadFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, sf::Rect<int> const&)'|
||error: ld returned 1 exit status|.

I looked for a reliable code from a tutorial, but this error still keeps occuring.
This is the code:

#include "SFML/Graphics.hpp"
#include <iostream>

int main()
{
        sf::RenderWindow window( sf::VideoMode( 600, 600 ), "SFML WORK!" );

        sf::Texture texture;

        if (!texture.loadFromFile("simplypears.jpg"))
        {
                std::cout << "Error loading paddle texture :(" << std::endl;
        }

        //sf::Sprite sprite(texture);

        // or

        sf::Sprite sprite;
        sprite.setTexture(texture);

        while ( window.isOpen( ) )
        {
                sf::Event event;

                while ( window.pollEvent( event ) )
                {
                        switch (event.type)
                        {
                        case sf::Event::Closed:
                                window.close();

                                break;

                        }
                }

                window.clear( );

                window.draw(sprite);

                window.display( );
        }
}
I really want to learn SFML and create cool things, but this exasperating error stops me.
So please help me!

Pages: [1]