Post the specific errors you’re getting, and perhaps someone with a Mac can help you out.
If you have a Linux or Windows box, you may want to try using that instead. Apple doesn’t seem interested in supporting OpenGL anymore (…though devs are finding ways around that).
I had to compile and build for glfw-2.7.6. So, I did run command that “make cocoa-install” in glfw-2.7.6 top directory. But command occured error. Error like this “symbol(s) not found for architecture x86_64”.
I want to change library glfw2 to glfw3. So I did changed CMakefiles some code and I saw same error with this first method.
I used “Homebrew”. Current version Homebrew was not supported “install glew2”. I have no idea how to install “glew2” on my computer.
I really don’t know how to run the sample code on my computer. But your advice very useful.
I read the article on OpenGL, OpenCL support and I think it’s right to use the Metal API. I think it would be more appropriate to use OpenGL on Windows to understand the graphics principle.
But if you see someone who knows how to fix it, please give me some advice on how to use it. I will also consider how to use OpenGL on the MacOS and how to run the sample code from this book.
PS: Sorry, but the reply post doesn’t contain a link. I keep getting an error when I try to insert a sample code file download link. The sample code can be found on Google by searching for “opengl super bible”. You can find it in the “Previous editions” menu on that site.
Ok. So if I understand correctly, you’re trying to build the OpenGL Superbible examples back from the 6th edition, not the ones for the latest 7th edition. And your problem isn’t really with the Superbible example code itself, but rather just building the GLFW dependency. And building this on Macbook. Is this correct?
Re building GLFW on MacBook, here’s a related link, which you may already have found:
unzip sb7code-master.zip
cd sb7code-master
In CMakeLists.txt, changed the "glfw3" in the following line to "glfw":
set(COMMON_LIBS sb7 glfw3 X11 Xrandr Xinerama Xi Xxf86vm Xcursor GL rt dl)
cd build
cmake ..
make -j8
cd ../bin/media
unzip superbible7-media.zip
cd ..
# Now you're ready to run binaries in this directory
Seems to work fine. But it does presume you have GLFW 3.x installed.
The reason for my one-line mod to CMakeLists.txt was that my local GLFW 3 library is named libglfw.so, not libglfw3.so.
No problem. New users can’t post links (URLs). However, once you have a few more posts on the forums, then you’ll be able to post them.
I reinstalled “GLFW3” which I installed via “Homebrew” via the link you gave me. I also noticed that “GLFW3” related files were created in “/usr/local/lib” and “/usr/local/include”.
I modified “CMakeLists.txt” as you told me. And I executed the command, but I’m getting an error as shown below.
Sounds like you need to 1) make sure pkg-config is installed, and if so, 2) tell CMake where to find it.
To install: brew install pkgconfig. Then just rerun the cmake .. step.
If it still doesn’t find it, determine where your pkg-config executable is, and either add it to your $PATH or give it to CMake by adding this line to your CMakeLists.txt with the correct path:
set(PKG_CONFIG_EXECUTABLE "/usr/bin/pkg-config")
Based on what you just previously said here, it sounds like it should be located in /usr/local/lib.
I use WebGL 1.0 and TypeScritp. You can host your application one time and it will be works on Desktop and Mobiles and everywhere where is a browser. Read this book: WebGL Programming Guide and use glMatrix. This is my example on Playground that I wrote in WebGL 1.0, TypeScript and glMatrix. It draws a triangle: Plunker - Triangle. glMatrix, WebGL, TypeScript
On Linux, librt.so is the POSIX Realtime Extensions library. It contains routines for 1) asynchronous I/O, 2) message queues, 3) shared memory access, and 4) per-process timers. Routines such as these:
It doesn’t look like any of the code in the Superbible 7 Examples code references the routines in this library directly. And it could be that none of your libraries on that platform depend on this librt library.
So I would try just removing it from the link line used by the examples and see if that resolved your problem.
Doing a quick grep, it appears that the “-lrt” is only provided in this file:
In this post, you indicated that you’d already successfully built (or obtained) a GLFW library, and had placed it in the sb7code-master/lib directory:
5. Copy libglfw3.a and paste sb7code-master/lib.
It sounds like that you just need to point the Superbible Examples build to where you put it, and link it with the name you’ve given it (glfw3 in the case of the above).
In sb7code-master/CMakeLists.txt, I think it already tells it to look in the sb7code-master/lib directory for libraries, so just place the glfw library in this directory (if it’s not already in a system directory):
I had understand what you said. I processed according to your advice. Additionally I added some source code to sb7code-master/CMakeLists.txt (I finished copying the build task related files).
After this process and I ran cmake .., make -j8 in sb7code-master/build. Fortunately, some seem to have been compiled. I ran a compiled example as shown below.
However, an error occurs about 30% of the compile process. Cause omp.h file not found. I think omp.h related “OpenMP”. So installed libomp, llvm using “Homebrew”.
Should I write the path for “OpenMP” in “CMakeLists.txt” again?
I don’t know much about “CMakeLists” so I don’t know how to write it. Most of the reasons I’ve been able to proceed here are due to your advice. Thank you so much