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

Can't build on OS X 10.9 #17

Open
ryu2 opened this issue May 9, 2014 · 8 comments
Open

Can't build on OS X 10.9 #17

ryu2 opened this issue May 9, 2014 · 8 comments

Comments

@ryu2
Copy link

ryu2 commented May 9, 2014

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

@josellausas
Copy link

I am having the same problem, had any luck finding a solution?

@boudr
Copy link

boudr commented Jun 1, 2014

Same issue here. :(

@bradc6
Copy link

bradc6 commented Jun 2, 2014

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

@emericaonline
Copy link

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/

@pybai
Copy link

pybai commented Jun 24, 2014

bradc6 is right. I chang to glfw-2.7.6 and it works.

@burtlo
Copy link

burtlo commented Sep 2, 2014

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

@YaleCheung
Copy link

I'm sorry, @pybai , how to change to glfw-2.7.6. I'm confused with the same question.

@TedaLIEz
Copy link

@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.

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