0

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?

3
  • What is the entire error? Commented Jun 28, 2014 at 6:16
  • @RetiredNinja That is all it says. It's under the "Problems" tab on eclipse. Commented Jun 28, 2014 at 6:38
  • You should be able to find the full error from the compiler output. Commented Jun 28, 2014 at 9:12

1 Answer 1

0

The console was outputting warning: libjpeg.so.62, needed by lib/libsfml-graphics.so, not found (try using -rpath or -rpath-link) which is where I was an idiot because I didn't look at this until RetiredNinja's comment.

To fix it just install libjpeg: sudo apt-get install libjpeg62

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.