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

Author Topic: Problem with SFML-compiling  (Read 1948 times)

0 Members and 1 Guest are viewing this topic.

Ancient

  • Newbie
  • *
  • Posts: 11
    • View Profile
Problem with SFML-compiling
« 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

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Problem with SFML-compiling
« Reply #1 on: August 13, 2009, 08:15:22 pm »
You have to link to sfml-window and sfml-graphics.
Laurent Gomila - SFML developer

Ancient

  • Newbie
  • *
  • Posts: 11
    • View Profile
Problem with SFML-compiling
« Reply #2 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

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Problem with SFML-compiling
« Reply #3 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.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything