Can't build on OS X 10.9
Opened this issue · 8 comments
Even though it says 10.9 is supported, after installing CMake and generating the Makefiles, I get:
[ 6%] Built target sb6 make[2]: *** No rule to make target
/usr/local/lib/libglfw.a', needed by bin/alienrain'. Stop. make[1]: *** [CMakeFiles/alienrain.dir/all] Error 2 make: *** [all] Error 2
I am having the same problem, had any luck finding a solution?
Same issue here. :(
The problem is due to GLFW has updated to a new API, so you can't use the GLFW v3 out of the box without updating the code. I am reimplementing much of the tutorials here @ https://github.com/bradc6/OpenGLSuperBible6
In order to compile them, you need to go into the extern folder, followed by the glfw-2.7.6 folder, and then follow the instructions in the readme.html file to compile glfw-2.7.6. This will overwrite some glfw3 files, so you'll have to reinstall glfw3 on your system if you'd like to go back.
However even afterwards you must change some of the shaders to version 410 instead of 430. Not all of the examples are fully support in OpenGL 4.1.
There should be some additional insight here.
http://www.openglsuperbible.com/2013/11/11/porting-samples-to-mac/
bradc6 is right. I chang to glfw-2.7.6 and it works.
This was failing for me. So I used brew to install the glfw2 library. However, not all of the examples work.
$ brew install --build-bottle --static glfw2
Here is a sample of the error and the commands I used to fix it.
$ cmake -G "Unix Makefiles"
-- The C compiler identification is AppleClang 5.1.0.5030040
-- The CXX compiler identification is AppleClang 5.1.0.5030040
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/franklinwebber/games/open_gl/sb6code
$ make
Scanning dependencies of target sb6
[ 1%] Building CXX object CMakeFiles/sb6.dir/src/sb6/sb6.cpp.o
[ 2%] Building CXX object CMakeFiles/sb6.dir/src/sb6/sb6ktx.cpp.o
[ 3%] Building CXX object CMakeFiles/sb6.dir/src/sb6/sb6object.cpp.o
[ 5%] Building CXX object CMakeFiles/sb6.dir/src/sb6/sb6shader.cpp.o
[ 6%] Building C object CMakeFiles/sb6.dir/src/sb6/gl3w.c.o
Linking CXX static library lib/libsb6.a
[ 6%] Built target sb6
Scanning dependencies of target alienrain
[ 7%] Building CXX object CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o
make[2]: *** No rule to make target `/usr/local/lib/libglfw.a', needed by `bin/alienrain'. Stop.
make[1]: *** [CMakeFiles/alienrain.dir/all] Error 2
make: *** [all] Error 2
$ brew install --build-bottle --static glfw2
$ git clean -df
Removing CMakeCache.txt
Removing CMakeFiles/
Removing Makefile
Removing cmake_install.cmake
Removing lib/libsb6.a
$ cmake -G "Unix Makefiles"
-- The C compiler identification is AppleClang 5.1.0.5030040
-- The CXX compiler identification is AppleClang 5.1.0.5030040
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/franklinwebber/games/open_gl/sb6code
$ make
Scanning dependencies of target sb6
[ 1%] Building CXX object CMakeFiles/sb6.dir/src/sb6/sb6.cpp.o
[ 2%] Building CXX object CMakeFiles/sb6.dir/src/sb6/sb6ktx.cpp.o
[ 3%] Building CXX object CMakeFiles/sb6.dir/src/sb6/sb6object.cpp.o
[ 5%] Building CXX object CMakeFiles/sb6.dir/src/sb6/sb6shader.cpp.o
[ 6%] Building C object CMakeFiles/sb6.dir/src/sb6/gl3w.c.o
Linking CXX static library lib/libsb6.a
[ 6%] Built target sb6
Scanning dependencies of target alienrain
[ 7%] Building CXX object CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o
...
[100%] Building CXX object CMakeFiles/wrapmodes.dir/src/wrapmodes/wrapmodes.cpp.o
Linking CXX executable bin/wrapmodes
I'm sorry, @pybai , how to change to glfw-2.7.6. I'm confused with the same question.
@burtlo I met the same problem in macOS 10.12.6, but I found the solution, at least for me :)
brew install --build-bottle --static glfw2
brew tells me something like:
This formula is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
For compilers to find this software you may need to set:
LDFLAGS: -L/usr/local/opt/glfw@2/lib
CPPFLAGS: -I/usr/local/opt/glfw@2/include
then
cmake -G "Unix Makefiles"
In the newly created CMakeLists.txt
, replace the value of ${EXTRA_LIBS}
to /usr/local/opt/glfw@2/lib/libglfw.a
, I am not sure the LDFLAGS told by brew will be the same as yours, you may change the path referring to the log.
and make, then wait for compiling :D.
Hope it helps.