Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Setting up SFML with Eclipse on Linux?  (Read 3547 times)

0 Members and 1 Guest are viewing this topic.

Harris6400

  • Newbie
  • *
  • Posts: 4
    • View Profile
Setting up SFML with Eclipse on Linux?
« on: August 18, 2014, 05:35:57 pm »
Hello. I understand the 'Setting up SFML with Eclipse' question is asked a lot, but I can't seem to find much help relating to same question when using Linux. I have installed the libsfml-dev package but I am unsure how to link the library to an Eclipse project. Could anyone help me out?

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Setting up SFML with Eclipse on Linux?
« Reply #1 on: August 18, 2014, 06:19:37 pm »
Have you read some of those other questions?
What have you tried already?
What errors are you getting?
Where did you get SFML from? What version?
What Eclipse version?

You really need to provide some details if you want help. You can't expect people to guess everything from vague hints.

Perhaps read this: http://www.catb.org/esr/faqs/smart-questions.html
And this: http://en.sfml-dev.org/forums/index.php?topic=5559.0
« Last Edit: August 18, 2014, 06:22:04 pm by Jesper Juhl »

Harris6400

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Setting up SFML with Eclipse on Linux?
« Reply #2 on: August 18, 2014, 06:27:18 pm »
Sorry, I wasn't sure what information to provide.

I haven't tried anything yet as I'm not sure what to do. I have the latest versions of SFML and Eclipse from the Ubuntu repository.

CrazyBillyO

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Setting up SFML with Eclipse on Linux?
« Reply #3 on: August 18, 2014, 08:13:36 pm »
If you haven't done so already, you'll first need to install the CDT plugin (http://www.eclipse.org/cdt/) for Eclipse in order to create C++ projects.  It should be available in the marketplace.

Harris6400

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Setting up SFML with Eclipse on Linux?
« Reply #4 on: August 18, 2014, 08:57:00 pm »
Oh I see, that's something I should have told you about. I have already done that.

CrazyBillyO

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Setting up SFML with Eclipse on Linux?
« Reply #5 on: August 19, 2014, 03:39:58 am »
If your SFML is installed under a directory on the library path, you should just have to include the libraries under the linker in the project's settings.  Under a project's properties, go to C/C++ Build -> Settings -> Tool Settings tab.  Assuming you're using GCC, under GCC C++ Linker -> Libraries individual dependencies can be added to the list of Libraries.  I usually add the following, in order, for SFML.

GL
GLEW
sfml-graphics
sfml-window
sfml-system

I tried a few quick searches but didn't find any decent documentation on this, but it's probably out there somewhere.  I suggest getting familiar with the build settings in Eclipse CDT, such as adding include and library directories, setting compiler settings, etc.  Also, if you obtained SFML from a repository, I'd check its version and consider compiling and installing the most recent version; there is a tutorial for this that makes it rather simple.

Harris6400

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Setting up SFML with Eclipse on Linux?
« Reply #6 on: August 20, 2014, 02:59:41 pm »
Thank you, that works fine.