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

Author Topic: Compiling example project  (Read 1698 times)

0 Members and 1 Guest are viewing this topic.

Woocash

  • Newbie
  • *
  • Posts: 6
    • View Profile
Compiling example project
« on: February 09, 2017, 12:53:29 am »
Hi,

I was trying to compile project from this topic: http://en.sfml-dev.org/forums/index.php?topic=11260.msg77960#msg77960
I tried to do that in two ways:

1. First with using SFML_STATIC_LIBS and MAN_STATIC_STD_LIBS. Something went wrong and I get this:

Code: [Select]
Could NOT find SFML (missing:  SFML_GRAPHICS_LIBRARY SFML_WINDOW_LIBRARY SFML_SYSTEM_LIBRARY)

-> SFML directory not found. Set SFML_ROOT to SFML's top-level path (containing "include" and "lib" directories).
-> Make sure the SFML libraries with the same configuration (Release/Debug, Static/Dynamic) exist.

So I tried to set SFML_ROOT and realized that there is no include folder in build folder. In tutorials I have seen path to this folder several times.

2. Without using those static libs, everything has been configured and compiled without any errors or warnings but I am seeing only black window.
OS: Ubuntu 16.04.1
SFML 2.4.1
Compiler: gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609

JayhawkZombie

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
Re: Compiling example project
« Reply #1 on: February 09, 2017, 02:09:46 am »
For the SFML_ROOT folder, just use the folder that contains all the SFML files. You should get an include folder when you downloaded the source.
I've gotten that cmake error (at least it looks like the ones I've gotten) and I remember getting it when I forgot to give the location for the lib files. Have you tried expanding the advanced options and setting them in there?

Woocash

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Compiling example project
« Reply #2 on: February 09, 2017, 03:56:51 am »
I have two folders with SFML, one with source code where is include folder and another with compiled SFML where is lib folder, which should I choose for SFML_ROOT? Should I copy include to build directory? I tried your suggestion with expanding the advanced options and I set those libraries with same paths as dynamic libs but again after compilation I get black window.
OS: Ubuntu 16.04.1
SFML 2.4.1
Compiler: gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609

Woocash

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Compiling example project
« Reply #3 on: February 11, 2017, 02:42:04 pm »
I solved my problem by not using static libraries. As I said I was getting black window, I solved that by coping game files (fonts, graphics, etc) to main directory and now it works but I can't understand why I have to copy those files, I think it should work without that.

I forget: my OS is Ubuntu 16.04.1, SFML 2.4.1, gcc 5.4
OS: Ubuntu 16.04.1
SFML 2.4.1
Compiler: gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609