Hi, I've just recently chosen to try out SFML with C++ and followed a video tutorial on Youtube to try and render a window (practice for a project I'm planning) and got the following errors:
/home/username/Documents/cppStuff/Window/SFML_Window.o||In function `main':|
SFML_Window.cpp|| undefined reference to `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'|
SFML_Window.cpp|| undefined reference to `sf::RenderWindow::RenderWindow(sf::VideoMode, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long, sf::WindowSettings const&)'|
SFML_Window.cpp|| undefined reference to `sf::Window::Close()'|
SFML_Window.cpp|| undefined reference to `sf::Window::GetEvent(sf::Event&)'|
SFML_Window.cpp|| undefined reference to `sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'|
SFML_Window.cpp|| undefined reference to `sf::RenderTarget::Clear(sf::Color const&)'|
SFML_Window.cpp|| undefined reference to `sf::Window::Display()'|
SFML_Window.cpp|| undefined reference to `sf::Window::IsOpened() const'|
SFML_Window.cpp|| undefined reference to `sf::RenderWindow::~RenderWindow()'|
SFML_Window.cpp|| undefined reference to `sf::RenderWindow::~RenderWindow()'|
SFML_Window.cpp|| undefined reference to `sf::RenderWindow::~RenderWindow()'|
||=== Build finished: 11 errors, 0 warnings ===|
I'm running Ubuntu 11.04 and have been using Gedit or Code::Blocks (depending on how much 'interface' I feel like tolerating). Here is the code from the tutorial, which I used:
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
int main()
{
sf::RenderWindow Game(sf::VideoMode(640, 480, 32), "SFML Test");
sf::Event Event;
while(Game.IsOpened())
{
while(Game.GetEvent(Event))
{
if(Event.Type == sf::Event::Closed)
Game.Close();
}
Game.Clear();
Game.Display();
}
return EXIT_SUCCESS;
}
I have no idea why these errors are happening (yes, I've installed sfml, and these errors happened in Code::Blocks, if I haven't already said so),
so I'm hoping someone here can tolerate the length of the post and lend a hand. Any help is appreciated, this kind of thing is ridiculously annoying. @_@; Thanks![/code]