Code Monkey home page Code Monkey logo

Comments (6)

r-pankevicius avatar r-pankevicius commented on August 16, 2024 1

Seems everything gets compiled fine, linking fails due to glibc version dependency. So it has nothing to do with tetris-csfml project so I'm closing the issue.

from tetris-csfml.

r-pankevicius avatar r-pankevicius commented on August 16, 2024

OK, found it listed in Depencies section in README, will try again next time.

from tetris-csfml.

r-pankevicius avatar r-pankevicius commented on August 16, 2024

I gave a next try, still want to add few cents here:

  1. Could you mention a command to pull dependencies in Dependencies section?:
    git submodule update --init --recursive

  2. make command will give an error:
    src/game.c:38:31: fatal error: SFML/System/Clock.h: No such file or directory
    #include <SFML/System/Clock.h>

  3. Inspecting what's under ./deps/SFML/System you will find that header files are .hpp, not h....

  4. Changing src/game.c lines to include .hpp instead of .h doesn't help, looks the Makefile isn't correct:
    #include <SFML/System/Clock.hpp>
    #include <SFML/Graphics/RenderWindow.hpp>

CC build/game.c.o
src/game.c:38:33: fatal error: SFML/System/Clock.hpp: No such file or directory
#include <SFML/System/Clock.hpp>

from tetris-csfml.

Oxore avatar Oxore commented on August 16, 2024

Hello, @r-pankevicius! Thank you for taking an interest in this project!

  1. Could you mention a command to pull dependencies in Dependencies section?:
    git submodule update --init --recursive

Yep, I definitely should mention this in Readme.md. I will do it.

Tried to play with free LinuxOne

Does it have GPU and any... virtual display? Doesn't look like a machine, that can be used for running tetris. But, anyway, it can theoretically have Xorg installed on it's OS and anything SFML would need for compilation, so let me explain what going wrong here.

  1. make command will give an error:
    src/game.c:38:31: fatal error: SFML/System/Clock.h: No such file or directory
    #include <SFML/System/Clock.h>

You don't have CSFML bindings installed on your system. It is expected if you just run make.

  1. Inspecting what's under ./deps/SFML/System you will find that header files are .hpp, not h....

They are under ./deps/CSFML/include/SFML.

I was expecting that if one decided to compile this project from source code, he/she will take a look at .travis.yml file and it is mentioned under "Compilation and usage" section. I should probably specify compilation commands explicitly in Readme.md.

If you don't have SFML and CSFML installed in your system then the following huge and complicated command (on bash or zsh) should build tetris binary with statically linked SFML and CSFML libraries. I Assume that you just cloned repository, changed working directory to cloned one (cd tetris-csfml), and pulled all submodules with git submodule update --init --recursive.

PFX=$(pwd)/prefix \
&& mkdir -p $PFX deps/SFML/build deps/CSFML/build \
&& pushd deps/SFML/build \
        && cmake \
          -DBUILD_SHARED_LIBS=OFF \
          -DCMAKE_INSTALL_PREFIX=$PFX \
          -DSFML_MISC_INSTALL_PREFIX=$PFX \
          -DSFML_DEPENDENCIES_INSTALL_PREFIX=$PFX \
          .. \
        && make install \
        && popd \
&& pushd deps/CSFML/build \
        && cmake \
          -DBUILD_SHARED_LIBS=OFF \
          -DCSFML_LINK_SFML_STATICALLY=TRUE \
          -DCMAKE_PREFIX_PATH=$PFX -DCMAKE_INSTALL_PREFIX=$PFX \
          .. \
        && make install \
        && popd \
&& make PREFIX=$PFX SFML_STATIC=y

This command will

  1. Set environment variable PFX to $(pwd)/prefix, where $(pwd) is absolute path to your current working directory, tetris-sfml repo clone.
  2. Create $PFX (is set to $(pwd)/prefix), deps/SFML/build and deps/CSFML/build directories for building and installing SFML and CSFML libraries. You also will need cmake for CSFML and SFML build process.
  3. Build static binary of SFML library in deps/SFML/build
  4. Build static binary of CSFML bindings library in deps/CSFML/build
  5. Build tetris using static SFML and CSFML library binaries.

Further rebuilds may be performed by following command

make PREFIX=$(pwd)/prefix SFML_STATIC=y

If you don't have enthusiasm anymore for taking actions I described above and working on this issue, then let me know or just close the issue.

from tetris-csfml.

r-pankevicius avatar r-pankevicius commented on August 16, 2024

@Oxore Vladimir, I have enthusiasm but I have a vacation now. Thanks for your response I will try your recipe later.

from tetris-csfml.

r-pankevicius avatar r-pankevicius commented on August 16, 2024

Uh... Found that I need to upgrade CMake

[linux1@prunce tetris-csfml]$ pushd deps/SFML/build \

    && cmake \
      -DBUILD_SHARED_LIBS=OFF \
      -DCMAKE_INSTALL_PREFIX=$PREFIX \
      -DSFML_MISC_INSTALL_PREFIX=$PREFIX \
      -DSFML_DEPENDENCIES_INSTALL_PREFIX=$PREFIX \
      .. \
    && make install \
    && popd

~/T/tetris-csfml/deps/SFML/build ~/T/tetris-csfml
CMake Error at CMakeLists.txt:5 (cmake_minimum_required):
CMake 3.0.2 or higher is required. You are running version 2.8.12.2

from tetris-csfml.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.