0

I am new to Linux and am currently using Linux Mint. I followed the instructions on this page, however whenever I go to compile the example code (given on the web page), the build fails.

g++ ~/Desktop/test.cpp -lglut gives me the following:

/usr/bin/ld: /tmp/cc3aKYsD.o: undefined reference to symbol 'glOrtho' /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status

Why does this keep occurring? I apologize for such a beginner question, but this is irritating.

Travis
  • 31
  • 1
  • 4

1 Answers1

4

You need to link with the OpenGL library as well:

g++ ~/Desktop/test.cpp -lglut -lGL
Overv
  • 8,433
  • 2
  • 40
  • 70