I compile a basic OpenGL program. But I got some problem in my environment.
And how to correctly compile it.
My Environment
OS is Mac OS X El Capitan 10.11
gcc version is Apple LLVM version 7.0.0 (clang-700.1.76)
Testing source code
Command I used
gcc -framework OpenGL -framework GLUT -Wno-deprecated -o program maze.cpp
Compiler error message
Undefined symbols for architecture x86_64:
"std::terminate()", referenced from:
___clang_call_terminate in Maze-ad3abe.o
"operator delete(void*)", referenced from:
std::__1::__vector_base<float, std::__1::allocator<float> >::~__vector_base() in Maze-ad3abe.o
"___cxa_begin_catch", referenced from:
___clang_call_terminate in Maze-ad3abe.o
"___cxa_call_unexpected", referenced from:
Tree::generateFractalTree() in Maze-ad3abe.o
"___gxx_personality_v0", referenced from:
Tree::Tree() in Maze-ad3abe.o
Tree::generateFractalTree() in Maze-ad3abe.o
Tree::~Tree() in Maze-ad3abe.o
Dwarf Exception Unwind Info (__eh_frame) in Maze-ad3abe.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
