1
Graphics / FIXED undefined reference to sf::RenderWindow::RenderWindow
« on: December 28, 2011, 07:19:52 pm »
This has been fixed after another full rebuild of SFML.. thanks
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
undefined reference to sf::RenderWindow::RenderWindow(sf::VideoMode, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, sf::ContextSettings const&)
sf::RenderWindow window(sf::VideoMode(640, 480), "Name");
$ g++ -g -o main main.cpp -lGL -lGLU -lsfml-graphics -lsfml-window -lsfml-system && ./main
0x104ab30
$ g++ -g -o main main.cpp -lGL -lGLU -lsfml-graphics -lsfml-window -lsfml-system && ./main
0x24cbb30
$ g++ -g -o main main.cpp -lGL -lGLU -lsfml-graphics -lsfml-window -lsfml-system && ./main
0x176eb30
$ g++ -g -o main main.cpp -lGL -lGLU -lsfml-graphics -lsfml-window -lsfml-system && ./main
0x838b30
(gdb) run
Starting program: /home/elijah/cplusplus/test/main
[Thread debugging using libthread_db enabled]
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff728b69c in sf::RenderTarget::Clear(sf::Color const&) () from /usr/lib/libsfml-graphics.so.2
(gdb) bt
#0 0x00007ffff728b69c in sf::RenderTarget::Clear(sf::Color const&) () from /usr/lib/libsfml-graphics.so.2
#1 0x0000000000400e02 in main () at main.cpp:26
(gdb)
#include <SFML/Graphics.hpp>
int main() {
// Create the main window
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
// Start the game loop
while (window.IsOpened()) {
// Process events
sf::Event event;
while (window.PollEvent(event)) {
// Close window : exit
if (event.Type == sf::Event::Closed) {
window.Close();
}
}
// Clear screen
window.Clear();
// Update the window
window.Display();
}
return EXIT_SUCCESS;
}