Shyamal Chandra
Shyamal Chandra

Reputation: 129

How do I solve the following linker error with my OpenGL program in Xcode?

I am getting the following errors when I try to compile my C++ OpenGL program in Xcode on Mac OS 10.8...What should I do?

Undefined symbols for architecture x86_64:
  "_aglChoosePixelFormat", referenced from:
      _main in main.o
  "_aglCreateContext", referenced from:
      _main in main.o
  "_aglDestroyContext", referenced from:
      _main in main.o
  "_aglDestroyPixelFormat", referenced from:
      _main in main.o
  "_aglSetCurrentContext", referenced from:
      _main in main.o
  "_aglSetFullScreen", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Upvotes: 0

Views: 1383

Answers (1)

TheAmateurProgrammer
TheAmateurProgrammer

Reputation: 9392

Since you're using AGL, looking at the reference for AGL, you need to import the framework AGL along with OpenGL.

Upvotes: 1

Related Questions