SFML community forums

Help => Graphics => Topic started by: Ancient on August 13, 2009, 07:36:36 pm

Title: Problem with SFML-compiling
Post by: Ancient on August 13, 2009, 07:36:36 pm
helllo community!

i wanted to work a bit with the sfml.
So I downloaded the files and worked
a bit with the tuts.

But now i have the problem,when i try
to compile a program, he gives out some error-messages.

Code: [Select]

C:\C++\SFML\main.cpp|7|undefined reference to `__imp___ZN2sf12RenderWindowC1ENS_9VideoModeERKSsmRKNS_14WindowSettingsE'|
C:\C++\SFML\main.cpp|22|undefined reference to `__imp___ZN2sf5ColorC1Ehhhh'|
C:\C++\SFML\main.cpp|22|undefined reference to `__imp___ZN2sf12RenderTarget5ClearERKNS_5ColorE'|
C:\C++\SFML\main.cpp|28|undefined reference to `sf::RenderWindow::~RenderWindow()'|
C:\C++\SFML\main.cpp|28|undefined reference to `sf::RenderWindow::~RenderWindow()'|
||=== Build finished: 5 errors, 0 warnings ===|


And the Code:
Code: [Select]

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

int main()
{
    // Create the main rendering window
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");

    // Start game loop
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }

        // Clear the screen (fill it with black color)
        App.Clear();

        // Display window contents on screen
        App.Display();
    }

    return EXIT_SUCCESS;
}


please help

Ancient
Title: Problem with SFML-compiling
Post by: Laurent on August 13, 2009, 08:15:22 pm
You have to link to sfml-window and sfml-graphics.
Title: Problem with SFML-compiling
Post by: Ancient on August 13, 2009, 08:20:51 pm
ty Laurent

it works.
i thought it could work without window, because
in the tutorial it sais:
SFML/Window.hpp is no more explicitly requiered, as it is already included by the graphics package.




Ancient
Title: Problem with SFML-compiling
Post by: Nexus on August 13, 2009, 08:32:50 pm
Quote from: "Ancient"
i thought it could work without window, because
in the tutorial it sais:
SFML/Window.hpp is no more explicitly requiered, as it is already included by the graphics package.
That only concerns the headers.