HackerPoet / MarbleMarcher

A Fractal Physics Game
GNU General Public License v2.0
2.48k stars 168 forks source link

clang can't find sfml headers :/ (macOS 10.14) #22

Closed tomlister closed 5 years ago

tomlister commented 5 years ago

The creation of the build system is fine, it can find sfml. But the compiler is not having it. I have tried everything...

tomlister:build tom.lister$ cmake .. -DCMAKE_TOOLCHAIN_FILE=/Users/tom.lister/vcpkg/scripts/buildsystems/vcpkg.cmake
-- The C compiler identification is AppleClang 10.0.0.10001145
-- The CXX compiler identification is AppleClang 10.0.0.10001145
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Freetype: /Users/tom.lister/vcpkg/installed/x64-osx/lib/libfreetype.a (found version "2.8.1")
-- Found ZLIB: /Users/tom.lister/vcpkg/installed/x64-osx/debug/lib/libz.a (foundversion "1.2.11")
-- Found PNG: /Users/tom.lister/vcpkg/installed/x64-osx/share/png/../../lib/libpng16.a (found version "1.4.12")
-- Found BZip2: /Users/tom.lister/vcpkg/installed/x64-osx/lib/libbz2.a (found version "1.0.6")
-- Looking for BZ2_bzCompressInit
-- Looking for BZ2_bzCompressInit - found
-- Found SFML 2.5.1 in /Users/tom.lister/vcpkg/installed/x64-osx/share/sfml
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/tom.lister/MarbleMarcher/build
tomlister:build tom.lister$ cd ..
tomlister:MarbleMarcher tom.lister$ cmake --build build
Scanning dependencies of target MarbleMarcherSources
[ 12%] Building CXX object src/CMakeFiles/MarbleMarcherSources.dir/Level.cpp.o
[ 25%] Building CXX object src/CMakeFiles/MarbleMarcherSources.dir/Overlays.cpp.o
In file included from /Users/tom.lister/MarbleMarcher/src/Overlays.cpp:17:
/Users/tom.lister/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
kraenhansen commented 5 years ago

I "fixed" this by setting the SFML_INCLUDE_DIR variable in the CMakeLists.txt:

set(SFML_INCLUDE_DIR "/Users/.../SFML-2.5.1-macos-clang/include")`
tomlister commented 5 years ago

@kraenhansen Thanks mate I'll test it.

tomlister commented 5 years ago

@kraenhansen Mate you are a fucking legend. I did that and if you use vcpkg you have to just use the whole include directory or it won't find SFML.