MattSW3
MattSW3

Reputation: 33

What is the linker flag for glad on Mac?

makefile:

SRC_DIR = src
BUILD_DIR = build/debug
CC = clang++
SRC_FILES = $(wildcard $(SRC_DIR)/*.cpp)
OBJ_NAME = game
INCLUDE_PATHS = -Iinclude
LIBRARY_PATHS = -Llib -Llib//Users/baguma/Downloads/glad-3 -Llib/GL 
COMPILER_FLAGS = -std=c++11 -Wall -O0 -g -arch x86_64 
LINKER_FLAGS = -lglfw3 -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo -lGLEW

all:
    $(CC) $(COMPILER_FLAGS) $(LINKER_FLAGS) $(INCLUDE_PATHS) $(LIBRARY_PATHS) $(SRC_FILES) -o $(BUILD_DIR)/$(OBJ_NAME)
clean:
    rm -r -f $(BUILD_DIR)/*

Error:

Undefined symbols for architecture x86_64:
  "_gladLoadGLLoader", referenced from:
      _main in main-d336bf.o
  "_glad_glViewport", referenced from:
      framebuffer_size_callback(GLFWwindow*, int, int) in main-d336bf.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [all] Error 1

I am trying to compile a program using OpenGl, GLFW and Glad.

Upvotes: 0

Views: 103

Answers (0)

Related Questions