Compilers & linkers don't care where they find libraries. As long as you point them to a library that is of a proper format, the compiler and linker will happily link to it. The location of the library, with respect to directory names, is purely for the aid of human organizational sanity, as well as possible conformity with some software installers and package managers.
Your linker is now looking for something to resolve two more references to external symbols:
Code:
second.cpp:(.text+0xa5): undefined reference to `glewInit'
second.cpp:(.text+0xaa): undefined reference to `__GLEW_VERSION_2_0'
If I were to hazard a guess, and based on your code that includes the
glew.h header file, I'd say that you need to add another library to the linker options: 'libglew'. Once again, find it, add it to the commandline, along with the location as an argument to the '-L' option. You do not need to add redundant '-L' options that point to the same place. The commandline
Code:
gcc second.cpp -L /usr/lib64 -L /usr/lib64 -lGL -lglut
can be shortened to
Code:
gcc second.cpp -L /usr/lib64 -lGL -lglut
--- rod.