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

Author Topic: Difficulty setting up SFML 2.1  (Read 1140 times)

0 Members and 1 Guest are viewing this topic.

Robostove

  • Newbie
  • *
  • Posts: 4
    • View Profile
Difficulty setting up SFML 2.1
« on: November 30, 2013, 08:47:14 am »
I'm trying to compile on Ubuntu.

There's no 2.1 package using apt-get, so I tried the CMake tutorial -

2.1 doesn't appear to have a CMakeLists.txt so I tried CodeBlocks -

I set up the compiler and linker search directories, linker settings, and I'm getting the following errors:

-------------- Build: Release in proj1 ---------------

Linking console executable: bin/Release/proj1
/usr/bin/ld: skipping incompatible /home/user/libs/SFML21/lib/libsfml-graphics.so when searching for -lsfml-graphics
/usr/bin/ld: cannot find -lsfml-graphics
/usr/bin/ld: skipping incompatible /home/user/libs/SFML21/lib/libsfml-window.so when searching for -lsfml-window
/usr/bin/ld: cannot find -lsfml-window
/usr/bin/ld: skipping incompatible /home/user/libs/SFML21/lib/libsfml-system.so when searching for -lsfml-system
/usr/bin/ld: cannot find -lsfml-system
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
3 errors, 0 warnings

I've tried it with and without using the SFML_STATIC macro. What's with the incompatible .so message?


Giving up, I tried compiling through the terminal-

g++ -c main.cpp -Ihome/libs/SFML21/include
 
and I get
main.cpp:2:29: fatal error: SFML/Graphics.hpp: No such file or directory
compilation terminated.

I don't understand why all of these seem to think that this directory doesn't exist... it's definitely there.

I'm a Linux newbie but this seems like it should be straightforward... What am I doing wrong?



eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
AW: Difficulty setting up SFML 2.1
« Reply #1 on: November 30, 2013, 11:33:17 am »
You need to compile the library itself first. You of course need the full source code, which contains a CMakeList.txt, and not just the headers.

After that follow the CMake tutorial step by step.
The follow the Code::Blocks tutorial step by step.

Randomly trying things without know what it actually does will rarely lead go useable results. ;)

You can also spend some time searching the forum, if you're stuck with something. We have quite a lot of similar threads and some have sometimes written down their steps again. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Robostove

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Difficulty setting up SFML 2.1
« Reply #2 on: December 01, 2013, 05:36:06 am »
Thanks, I've managed to get everything working.

Should have read the tutorial more carefully  ;D


 

anything