0

Macbook Air 2020, m1 chip, macOS 12.1 Monterey. No XCode. Though I have XCode Command Line tools.

I'm trying out OpenGL. I installed it: brew install glfw. I wrote this test.cpp:

#include <GLFW/glfw3.h>
int main(void)
{
    
    GLFWwindow* window;

    if (!glfwInit())
        return -1;

    return 0;

}

In Terminal, I run g++ -I/opt/homebrew/Cellar/glfw/3.3.6/include -o ./test ./test.cpp

And get this error: clang: error: linker command failed with exit code 1 (use -v to see invocation)

What should I do?

drescherjm
  • 10,365
  • 5
  • 44
  • 64

0 Answers0