Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to compile on OSX #9

Open
joaquincasares opened this issue Jan 9, 2019 · 12 comments
Open

Failed to compile on OSX #9

joaquincasares opened this issue Jan 9, 2019 · 12 comments

Comments

@joaquincasares
Copy link

I stumbled upon this via Reddit. Cool looking game!

First, I needed to also install cmake:

brew install cmake

But I'm still having issues on the cmake command:

[Wed Jan 09] 12:49 PM:~/repos/personal/MarbleMarcher/build[master] (casares)$ brew reinstall sfml
==> Reinstalling sfml
==> Downloading https://homebrew.bintray.com/bottles/sfml-2.4.2_1.mojave.bottle.1.tar.gz
Already downloaded: /Users/casares/Library/Caches/Homebrew/downloads/5225f9fe06926bc770df12433ea4585e34775e491eae886cce1b38bc822cbca3--sfml-2.4.2_1.mojave.bottle.1.tar.gz
==> Pouring sfml-2.4.2_1.mojave.bottle.1.tar.gz
🍺  /usr/local/Cellar/sfml/2.4.2_1: 132 files, 1.7MB
[Wed Jan 09] 12:49 PM:~/repos/personal/MarbleMarcher/build[master] (casares)$ cmake ..
CMake Error at CMakeLists.txt:8 (find_package):
  By not providing "FindSFML.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "SFML", but
  CMake did not find one.

  Could not find a package configuration file provided by "SFML" (requested
  version 2.5) with any of the following names:

    SFMLConfig.cmake
    sfml-config.cmake

  Add the installation prefix of "SFML" to CMAKE_PREFIX_PATH or set
  "SFML_DIR" to a directory containing one of the above files.  If "SFML"
  provides a separate development package or SDK, be sure it has been
  installed.


-- Configuring incomplete, errors occurred!
See also "/Users/casares/repos/personal/MarbleMarcher/build/CMakeFiles/CMakeOutput.log".

Thanks for any help!

@Jbaud
Copy link

Jbaud commented Jan 9, 2019

The latest version available on brew is the 2.4.2. This game requires 2.5 so you will have to download sfml from their website.

After doing that I had to modify the cmake file as instructed by the installer and set
CMAKE_PREFIX_PATH and SFML_DIR in the mable marcher directory.

Hope that helps

@ncovercash
Copy link

@Jbaud What did you modify? I never saw anything about the cmake file in the installer. I installed SFML per sfml-dev.org's instructions, and now get the following output from cmake --build build:

-- Found SFML 2.5.1 in /Library/Frameworks/SFML.framework/Resources/CMake
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/redacted/MarbleMarcher/build
[ 12%] Building CXX object src/CMakeFiles/MarbleMarcherSources.dir/Overlays.cpp.o
In file included from /Users/redacted/MarbleMarcher/src/Overlays.cpp:17:
/Users/redacted/MarbleMarcher/src/Overlays.h:18:10: fatal error: 'SFML/Graphics.hpp' file not found
#include <SFML/Graphics.hpp>
         ^~~~~~~~~~~~~~~~~~~

1 error generated.
make[2]: *** [src/CMakeFiles/MarbleMarcherSources.dir/Overlays.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/MarbleMarcherSources.dir/all] Error 2
make: *** [all] Error 2

@lateralpunk
Copy link

I found a temporary fix. in build/src/CmakeFiles/MarbleMarcerSources.dir/flags.make, manually type the include path to SFML as it is missing

CXX_INCLUDES = -I/usr/local/include/eigen3 -I/Users/k5patel/workspace/computer-graphics/SFML/include

@ncovercash
Copy link

ncovercash commented Jan 10, 2019 via email

@lateralpunk
Copy link

just manually copy the built executable over to the root directory.

@jgoldfar
Copy link
Contributor

You can accomplish the same as below

I found a temporary fix. in build/src/CmakeFiles/MarbleMarcerSources.dir/flags.make, manually type the include path to SFML as it is missing

CXX_INCLUDES = -I/usr/local/include/eigen3 -I/Users/k5patel/workspace/computer-graphics/SFML/include

at the configuration step by passing by passing something like -DCMAKE_CXX_FLAGS="-I/usr/local/include/eigen3 ..." to cmake.

@nobodywasishere
Copy link

The latest version available on brew is the 2.4.2. This game requires 2.5 so you will have to download sfml from their website.

After doing that I had to modify the cmake file as instructed by the installer and set
CMAKE_PREFIX_PATH and SFML_DIR in the mable marcher directory.

Hope that helps

How did you download it from their website? I downloaded a folder with doc, Frameworks, examples, etc in it but I'm completely lost on what to do with it.

@BaconWrappedShrimpWithEyes

The tutorial on the sfml website will teach you how to install it.

@nobodywasishere
Copy link

@lateralpunk What path are you talking about? As I do not have anything remotely similar on my computer.

I found a temporary fix. in build/src/CmakeFiles/MarbleMarcerSources.dir/flags.make, manually type the include path to SFML as it is missing

CXX_INCLUDES = -I/usr/local/include/eigen3 -I/Users/k5patel/workspace/computer-graphics/SFML/include

@mygizli04
Copy link

I installed the sfml manually, and now it says success but no binary. ( Here's the terminal log:

bash-3.2$ cmake -build build
-- Found SFML 2.5.1 in /Library/Frameworks/SFML.framework/Resources/CMake
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/USER/Desktop/MarbleMarcher/build

)

@ivankolesnik
Copy link

As of today, SFML in Homebrew is already updated to version 2.5.1. I managed to build with this sequence:

mkdir build && cd build
cmake -DCMAKE_CXX_FLAGS="-I/usr/local/include" ..
cd ..
cmake --build build

And it produced a binary file. Also I think that /usr/local/include folder should be added in flags.make file.

@joaquincasares
Copy link
Author

joaquincasares commented Mar 19, 2019

This now builds and I'm able to run it with:

LD_LIBRARY_PATH=`pwd`/usr/lib ./build/MarbleMarcher

However, the graphics get glitchy as soon as the level is built and mainly disappear as the world spins. Nevermind, it works! The mouse sensitivity is found on the Pause Screen and can be fixed a bit. Glad to see it though! :D

TrevorSayre added a commit to TrevorSayre/MarbleMarcher that referenced this issue Apr 21, 2019
Remove note about homebrew not having the latest SFML as this has been addressed
Add flags to `cmake` command inside build directory to fix missing `SFML/Graphics.hpp`

HackerPoet#9 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants