我正在尝试让 SFML 在 code::blocks 上工作,但每当我尝试测试示例代码时,我都会遇到错误。我按照http://www.sfml-dev.org/tutorials/2.0/start-cb.php的教程进行操作,但它似乎不起作用。
我不是很擅长这个,所以如果有人可以帮助它会很棒。
这是代码和错误的屏幕截图:http: //i39.tinypic.com/nbdysj.jpg
以下是错误:
obj\Debug\test.o||In function `main':|
C:\Users\Mads\Desktop\test\test.cpp|5|undefined reference to `sf::String::String(char const*, std::locale const&)'|
C:\Users\Mads\Desktop\test\test.cpp|5|undefined reference to `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'|
C:\Users\Mads\Desktop\test\test.cpp|5|undefined reference to `sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)'|
C:\Users\Mads\Desktop\test\test.cpp|6|undefined reference to `sf::CircleShape::CircleShape(float, unsigned int)'|
C:\Users\Mads\Desktop\test\test.cpp|5|undefined reference to `sf::RenderWindow::~RenderWindow()'|
C:\Users\Mads\Desktop\test\test.cpp|7|undefined reference to `sf::Color::Green'|
C:\Users\Mads\Desktop\test\test.cpp|7|undefined reference to `sf::Shape::setFillColor(sf::Color const&)'|
C:\Users\Mads\Desktop\test\test.cpp|15|undefined reference to `sf::Window::close()'|
C:\Users\Mads\Desktop\test\test.cpp|12|undefined reference to `sf::Window::pollEvent(sf::Event&)'|
C:\Users\Mads\Desktop\test\test.cpp|18|undefined reference to `sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'|
C:\Users\Mads\Desktop\test\test.cpp|18|undefined reference to `sf::RenderTarget::clear(sf::Color const&)'|
C:\Users\Mads\Desktop\test\test.cpp|19|undefined reference to `sf::RenderStates::Default'|
C:\Users\Mads\Desktop\test\test.cpp|19|undefined reference to `sf::RenderTarget::draw(sf::Drawable const&, sf::RenderStates const&)'|
C:\Users\Mads\Desktop\test\test.cpp|20|undefined reference to `sf::Window::display()'|
C:\Users\Mads\Desktop\test\test.cpp|9|undefined reference to `sf::Window::isOpen() const'|
C:\Users\Mads\Desktop\test\test.cpp|23|undefined reference to `sf::RenderWindow::~RenderWindow()'|
C:\Users\Mads\Desktop\test\test.cpp|23|undefined reference to `sf::RenderWindow::~RenderWindow()'|
obj\Debug\test.o||In function `~CircleShape':|
C:\Users\Mads\Desktop\SFML-2.0\include\SFML\Graphics\CircleShape.hpp|42|undefined reference to `vtable for sf::CircleShape'|
C:\Users\Mads\Desktop\SFML-2.0\include\SFML\Graphics\CircleShape.hpp|42|undefined reference to `vtable for sf::CircleShape'|
C:\Users\Mads\Desktop\SFML-2.0\include\SFML\Graphics\CircleShape.hpp|42|undefined reference to `sf::Shape::~Shape()'|
||=== Build finished: 20 errors, 0 warnings ===|