c++ - How do header files like OpenGL.h work -


i understand header files processed prior compilation of remainder of source file in included make process of developing code easier. know allow working declarations. however, don't see functions in use in header file opengl.h in tutorials have been researching. opengl.h obscure me #define extern. don't know happening. instance

#define cgl_version_1_0  1 #define cgl_version_1_1  1 #define cgl_version_1_2  1 #define cgl_version_1_3  1   extern cglerror cglqueryrendererinfo(gluint display_mask, cglrendererinfoobj *rend, glint *nrend);  extern cglerror cgldestroyrendererinfo(cglrendererinfoobj rend); extern cglerror cgldescriberenderer(cglrendererinfoobj rend, glint rend_num, cglrendererproperty prop, glint *value); 

i have no idea happening here, , have come across other c++ includes share similar obscurity. write library of own , feel popper header files outlined in manner.

to me seems happening keywords or variables being made, or functions don't have code block. have taken 2 courses in c++, introduction , c++ did not touch on topic in detail.

i trying deobfuscate happening.

usually, library headers not contain implementations (exceptions are, example, header-only libraries, loads of c++ template code). headers provide information on how call library functions, is, data types , signatures. implementation contained in static or shared library.

strictly speaking, opengl not library, specification, while opengl implementation provided shared library. is, implementation of opengl functions stored bunch of binary data holding compiled code. if want sources, need check implementation of opengl using (it nvidia drivers, example, , doubt real sources available).

in order understand, how compiled code gets linked code , how headers involved in process, recommend read more c++ compillation process , static , dynamic linking.


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -