I am running a 2018 intel mac mini on macos sonoma. I’m using glad to load functions, and glfw to initiate the opengl context. This comes from following the learnopengl getting started tutorial. On my other older machine I had no warnings.
Here are a few of the errors, there are a couple dozen more missing functions.
dlsym cannot find symbol glVertexP2ui in CFBundle 0x600001185a40 </System/Library/Frameworks/OpenGL.framework> (framework, loaded): dlsym(0x7ff900e10321, glVertexP2ui): symbol not found
dlsym cannot find symbol glVertexP2uiv in CFBundle 0x600001185a40 </System/Library/Frameworks/OpenGL.framework> (framework, loaded): dlsym(0x7ff900e10321, glVertexP2uiv): symbol not found
dlsym cannot find symbol glVertexP3ui in CFBundle 0x600001185a40 </System/Library/Frameworks/OpenGL.framework> (framework, loaded): dlsym(0x7ff900e10321, glVertexP3ui): symbol not found
dlsym cannot find symbol glVertexP3uiv in CFBundle 0x600001185a40 </System/Library/Frameworks/OpenGL.framework> (framework, loaded): dlsym(0x7ff900e10321, glVertexP3uiv): symbol not found
Here’s the code, though I’ve literally just copy pasted the tutorial code. Trying to get opengl up and running on this newer more powerful machine:
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <iostream>
void framebuffer_size_callback(GLFWwindow* window, int width, int height);
void processInput(GLFWwindow *window);
// settings
const unsigned int SCR_WIDTH = 800;
const unsigned int SCR_HEIGHT = 600;
int main()
{
// glfw: initialize and configure
// ------------------------------
glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
#ifdef __APPLE__
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
#endif
// glfw window creation
// --------------------
GLFWwindow* window = glfwCreateWindow(SCR_WIDTH, SCR_HEIGHT, "SplineStudy", NULL, NULL);
if (window == NULL)
{
std::cout << "Failed to create GLFW window" << std::endl;
glfwTerminate();
return -1;
}
glfwMakeContextCurrent(window);
glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);
// glad: load all OpenGL function pointers
// ---------------------------------------
if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress))
{
std::cout << "Failed to initialize GLAD" << std::endl;
return -1;
}
// render loop
// -----------
while (!glfwWindowShouldClose(window))
{
// input
// -----
processInput(window);
// render
// ------
glClearColor(0.2f, 0.3f, 0.3f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
// glfw: swap buffers and poll IO events (keys pressed/released, mouse moved etc.)
// -------------------------------------------------------------------------------
glfwSwapBuffers(window);
glfwPollEvents();
}
// glfw: terminate, clearing all previously allocated GLFW resources.
// ------------------------------------------------------------------
glfwTerminate();
return 0;
}
// process all input: query GLFW whether relevant keys are pressed/released this frame and react accordingly
// ---------------------------------------------------------------------------------------------------------
void processInput(GLFWwindow *window)
{
if(glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS)
glfwSetWindowShouldClose(window, true);
}
// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
glViewport(0, 0, width, height);
}
Any insight would be greatly appreciated. I assume I’m making a silly mistake in my project config because I can’t find anything online.
I compiled glfw from source with cmake and linked using that static library and including opengl, cocoa and iokit as per the glfw macos + xcode docs.
I tried downloading the macos intel glfw binary and using the dynamic library but the issue remained.
I printed the opengl version of the machine (4.1) and downloaded the exact match glad assets using core profile and generate a loader checked off. Subbed those in to the include path and the source into the project. Issue remained.
It just seemed to me like those functions are actually missing on my machine, so I’m now asking here.