SFML 2.6.0 and g++
I am trying to compile my project with these commands:
g++ -c main.cpp -I"E:\C++\Real Engine\Real Engine\include" -DSFML_STATIC
g++ -L"E:\C++\Real Engine\Real Engine\lib\SFML" main.o -o main -lsfml-graphics-s -lsfml-window-s -lsfml-system-s -lopengl32 -lwinmm -lgdi32
But it gives the following error:
main.o:main.cpp:(.text+0x1c): undefined reference to `_imp____glutInitWithExit@12'
main.o:main.cpp:(.text+0x3f): undefined reference to `_imp____glutCreateWindowWithExit@8'
main.o:main.cpp:(.text+0x61): undefined reference to `_imp____glutCreateMenuWithExit@8'
main.o:main.cpp:(.text+0x7e): undefined reference to `sf::Shape::Shape()'
main.o:main.cpp:(.text+0xbe): undefined reference to `sf::Shape::update()'
main.o:main.cpp:(.text+0xcc): undefined reference to `sf::Shape::~Shape()'
main.o:main.cpp:(.text+0x106): undefined reference to `sf::Shape::update()'
main.o:main.cpp:(.text+0x145): undefined reference to `sf::Shape::update()'
main.o:main.cpp:(.text+0x2c2): undefined reference to `sf::Shape::Shape()'
main.o:main.cpp:(.text+0x305): undefined reference to `sf::Shape::update()'
main.o:main.cpp:(.text+0x313): undefined reference to `sf::Shape::~Shape()'
main.o:main.cpp:(.text+0x345): undefined reference to `sf::Shape::update()'
main.o:main.cpp:(.text+0x37d): undefined reference to `sf::Shape::update()'
main.o:main.cpp:(.text+0x3b5): undefined reference to `sf::Shape::update()'
main.o:main.cpp:(.text+0x5f3): undefined reference to `sf::Keyboard::isKeyPressed(sf::Keyboard::Key)'
main.o:main.cpp:(.text+0x616): undefined reference to `sf::Joystick::isConnected(unsigned int)'
main.o:main.cpp:(.text+0x639): undefined reference to `sf::Joystick::isConnected(unsigned int)'
main.o:main.cpp:(.text+0x648): undefined reference to `sf::Joystick::getButtonCount(unsigned int)'
main.o:main.cpp:(.text+0x662): undefined reference to `sf::Joystick::isConnected(unsigned int)'
main.o:main.cpp:(.text+0x678): undefined reference to `sf::Joystick::isButtonPressed(unsigned int, unsigned int)'
main.o:main.cpp:(.text+0x692): undefined reference to `sf::Joystick::isConnected(unsigned int)'
main.o:main.cpp:(.text+0x6a8): undefined reference to `sf::Joystick::getAxisPosition(unsigned int, sf::Joystick::Axis)'
main.o:main.cpp:(.text+0x720): undefined reference to `sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'
main.o:main.cpp:(.text+0x808): undefined reference to `sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'
main.o:main.cpp:(.text+0x8dc): undefined reference to `sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'
main.o:main.cpp:(.text+0x9ad): undefined reference to `sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'
main.o:main.cpp:(.text+0xa7e): undefined reference to `sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'
main.o:main.cpp:(.text+0xbd8): undefined reference to `sf::RenderWindow::setActive(bool)'
main.o:main.cpp:(.text+0xc57): undefined reference to `sf::Image::Image()'
main.o:main.cpp:(.text+0xc6b): undefined reference to `sf::Image::loadFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
main.o:main.cpp:(.text+0xc8e): undefined reference to `sf::Image::getPixelsPtr() const'
main.o:main.cpp:(.text+0xc9d): undefined reference to `sf::Image::getSize() const'
main.o:main.cpp:(.text+0xcac): undefined reference to `sf::Image::getSize() const'
main.o:main.cpp:(.text+0xcc1): undefined reference to `sf::Window::setIcon(unsigned int, unsigned int, unsigned char const*)'
main.o:main.cpp:(.text+0xcd1): undefined reference to `sf::Clock::Clock()'
main.o:main.cpp:(.text+0xcde): undefined reference to `sf::Clock::Clock()'
main.o:main.cpp:(.text+0xcf1): undefined reference to `sf::Window::pollEvent(sf::Event&)'
main.o:main.cpp:(.text+0xd45): undefined reference to `sf::Mouse::setPosition(sf::Vector2<int> const&, sf::Window const&)'
main.o:main.cpp:(.text+0xd51): undefined reference to `sf::Window::isOpen() const'
main.o:main.cpp:(.text+0xd6c): undefined reference to `sf::Window::pollEvent(sf::Event&)'
main.o:main.cpp:(.text+0xda5): undefined reference to `sf::Window::close()'
main.o:main.cpp:(.text+0xefd): undefined reference to `sf::Mouse::setPosition(sf::Vector2<int> const&, sf::Window const&)'
main.o:main.cpp:(.text+0x11df): undefined reference to `gluPerspective@32'
main.o:main.cpp:(.text+0x1254): undefined reference to `gluLookAt@72'
main.o:main.cpp:(.text+0x1409): undefined reference to `sf::RenderTarget::pushGLStates()'
main.o:main.cpp:(.text+0x1416): undefined reference to `sf::Clock::getElapsedTime() const'
main.o:main.cpp:(.text+0x1426): undefined reference to `sf::Time::asMicroseconds() const'
main.o:main.cpp:(.text+0x145e): undefined reference to `sf::Clock::getElapsedTime() const'
main.o:main.cpp:(.text+0x146e): undefined reference to `sf::Time::asMicroseconds() const'
main.o:main.cpp:(.text+0x14fb): undefined reference to `sf::Color::White'
main.o:main.cpp:(.text+0x152e): undefined reference to `sf::Clock::restart()'
main.o:main.cpp:(.text+0x1538): undefined reference to `sf::RenderTarget::popGLStates()'
main.o:main.cpp:(.text+0x1542): undefined reference to `sf::Window::display()'
main.o:main.cpp:(.text+0x1559): undefined reference to `sf::Image::~Image()'
main.o:main.cpp:(.text+0x1592): undefined reference to `sf::Image::~Image()'
main.o:main.cpp:(.text+0x15c0): undefined reference to `sf::Font::Font()'
main.o:main.cpp:(.text+0x15d3): undefined reference to `sf::Font::loadFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
main.o:main.cpp:(.text+0x15e3): undefined reference to `sf::Text::Text()'
main.o:main.cpp:(.text+0x15f9): undefined reference to `sf::Text::setFont(sf::Font const&)'
main.o:main.cpp:(.text+0x161d): undefined reference to `sf::String::String(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::locale const&)'
main.o:main.cpp:(.text+0x1633): undefined reference to `sf::Text::setString(sf::String const&)'
main.o:main.cpp:(.text+0x165d): undefined reference to `sf::Text::setCharacterSize(unsigned int)'
main.o:main.cpp:(.text+0x1673): undefined reference to `sf::Text::setFillColor(sf::Color const&)'
main.o:main.cpp:(.text+0x1690): undefined reference to `sf::Text::setStyle(unsigned int)'
main.o:main.cpp:(.text+0x16ca): undefined reference to `sf::Transformable::setPosition(float, float)'
main.o:main.cpp:(.text+0x16d5): undefined reference to `sf::RenderStates::Default'
main.o:main.cpp:(.text+0x16e8): undefined reference to `sf::RenderTarget::draw(sf::Drawable const&, sf::RenderStates const&)'
main.o:main.cpp:(.text+0x170a): undefined reference to `sf::Font::~Font()'
main.o:main.cpp:(.text+0x1755): undefined reference to `sf::Font::~Font()'
main.o:main.cpp:(.text+0x17c8): undefined reference to `sf::CircleShape::CircleShape(float, unsigned int)'
main.o:main.cpp:(.text+0x1808): undefined reference to `sf::Transformable::setPosition(float, float)'
main.o:main.cpp:(.text+0x181e): undefined reference to `sf::Shape::setFillColor(sf::Color const&)'
main.o:main.cpp:(.text+0x1829): undefined reference to `sf::RenderStates::Default'
main.o:main.cpp:(.text+0x183c): undefined reference to `sf::RenderTarget::draw(sf::Drawable const&, sf::RenderStates const&)'
main.o:main.cpp:(.text+0x190d): undefined reference to `sf::Shape::setFillColor(sf::Color const&)'
main.o:main.cpp:(.text+0x1947): undefined reference to `sf::Transformable::setPosition(float, float)'
main.o:main.cpp:(.text+0x1952): undefined reference to `sf::RenderStates::Default'
main.o:main.cpp:(.text+0x1965): undefined reference to `sf::RenderTarget::draw(sf::Drawable const&, sf::RenderStates const&)'
main.o:main.cpp:(.text+0x19f4): undefined reference to `sf::Music::Music()'
main.o:main.cpp:(.text+0x1a07): undefined reference to `sf::Music::openFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
main.o:main.cpp:(.text+0x1a17): undefined reference to `sf::SoundStream::play()'
main.o:main.cpp:(.text+0x1a24): undefined reference to `sf::Music::getDuration() const'
main.o:main.cpp:(.text+0x1a34): undefined reference to `sf::Time::asMilliseconds() const'
main.o:main.cpp:(.text+0x1a51): undefined reference to `sf::Music::~Music()'
main.o:main.cpp:(.text+0x1a66): undefined reference to `sf::Music::~Music()'
main.o:main.cpp:(.text+0x1ac5): undefined reference to `sf::SoundBuffer::SoundBuffer()'
main.o:main.cpp:(.text+0x1ad5): undefined reference to `sf::SoundBuffer::loadFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
main.o:main.cpp:(.text+0x1ae2): undefined reference to `sf::Sound::Sound()'
main.o:main.cpp:(.text+0x1af2): undefined reference to `sf::Sound::setBuffer(sf::SoundBuffer const&)'
main.o:main.cpp:(.text+0x1aff): undefined reference to `sf::Sound::play()'
main.o:main.cpp:(.text+0x1b1d): undefined reference to `sf::Sound::~Sound()'
main.o:main.cpp:(.text+0x1b27): undefined reference to `sf::SoundBuffer::~SoundBuffer()'
main.o:main.cpp:(.text+0x1b39): undefined reference to `sf::Sound::~Sound()'
main.o:main.cpp:(.text+0x1b49): undefined reference to `sf::SoundBuffer::~SoundBuffer()'
main.o:main.cpp:(.text+0x231c): undefined reference to `sf::RenderWindow::~RenderWindow()'
main.o:main.cpp:(.text+0x2477): undefined reference to `sf::Color::Color()'
main.o:main.cpp:(.text+0x24e8): undefined reference to `sf::String::String(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::locale const&)'
main.o:main.cpp:(.text+0x2512): undefined reference to `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'
main.o:main.cpp:(.text+0x254a): undefined reference to `sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)'
main.o:main.cpp:(.text$_ZN10game_world5voxelC1Ev[__ZN10game_world5voxelC1Ev]+0x1c): undefined reference to `sf::Color::Color()'
main.o:main.cpp:(.rdata$_ZTVN3crd8SquircleE[__ZTVN3crd8SquircleE]+0x10): undefined reference to `sf::Shape::draw(sf::RenderTarget&, sf::RenderStates) const'
main.o:main.cpp:(.text$_ZN3crd8SquircleD1Ev[__ZN3crd8SquircleD1Ev]+0x24): undefined reference to `sf::Shape::~Shape()'
main.o:main.cpp:(.rdata$_ZTVN3crd9RoundRectE[__ZTVN3crd9RoundRectE]+0x10): undefined reference to `sf::Shape::draw(sf::RenderTarget&, sf::RenderStatmain.o:main.cpp:(.text$_ZN3crd9RoundRectD1Ev[__ZN3crd9RoundRectD1Ev]+0x24): undefined reference to `sf::Shape::~Shape()'
main.o:main.cpp:(.text$_ZN2sf11VertexArrayD1Ev[__ZN2sf11VertexArrayD1Ev]+0xa): undefined reference to `vtable for sf::VertexArray'
main.o:main.cpp:(.text$_ZN2sf4TextD1Ev[__ZN2sf4TextD1Ev]+0xa): undefined reference to `vtable for sf::Text'
main.o:main.cpp:(.text$_ZN2sf4TextD1Ev[__ZN2sf4TextD1Ev]+0x14): undefined reference to `vtable for sf::Text'
main.o:main.cpp:(.text$_ZN2sf4TextD1Ev[__ZN2sf4TextD1Ev]+0x54): undefined reference to `sf::Transformable::~Transformable()'
main.o:main.cpp:(.text$_ZN2sf11CircleShapeD1Ev[__ZN2sf11CircleShapeD1Ev]+0xa): undefined reference to `vtable for sf::CircleShape'
main.o:main.cpp:(.text$_ZN2sf11CircleShapeD1Ev[__ZN2sf11CircleShapeD1Ev]+0x14): undefined reference to `vtable for sf::CircleShape'
main.o:main.cpp:(.text$_ZN2sf11CircleShapeD1Ev[__ZN2sf11CircleShapeD1Ev]+0x24): undefined reference to `sf::Shape::~Shape()'
collect2.exe: error: ld returned 1 exit status