I'm trying to setup an SFML 2.1 64 bit project on Ubuntu 12.04(also 64 bit) using eclipse cdt.
- First I made a new project called LearningSFML.
- Then I went to Project>Properties>C/C++ Build>Settings
- Under GCC C++ Compiler>Includes I added the path to my include folder
- And under GCC C++ Linker>Libraries I added
sfml-window,sfml-graphics,sfml-system(in that order) to the "Libraries" list - And finally added < SFML_PATH >/lib to the "Library search path" list box
After doing this, I tested it with the following code
#include <SFML/Window.hpp>
int main()
{
sf::Window window(sf::VideoMode(640, 480), "Learning SFML");
return 0;
}
And if flashed a window as you would expect. But changing the code slightly to use sf::RenderWindow instead of sf::Window:
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(640, 480), "Learning SFML");
return 0;
}
creates an error saying make: *** [LearningSFML] Error 1. I searched the internet for similar problems. One website I found said that the error means there is no main function, but clearly I do have a main function.
So how can I fix this error?