The use of TCC is exemplified by the use of the third party libraries, including: OpenGL, GMP, SDL, etc.
1.TCC using GLUT
Go to OpenGL to download http://www.opengl.org/resources/libraries/glut/Glutdlls37beta. zip.
If you can't download it, you can download Glutdlls37beta. zip from my web drive.
In addition, header files GL.h and GLU.h can be found in the compiler's directory. File Search please use software everything.
Place the GL.h, GLU.h, glut.h into the INCLUDE/GL directory under the TCC root directory and put the Glut.dll in the TCC root directory.
Use Tiny_impdef.exe to generate Opengl32.def, Glu32.def, glut.def from Opengl32.dll, Glu32.dll, Glut.dll, and into the Lib directory.
Glut.h Configuration modification: Append # <windows.h> to the front, and then remove the extra. lib suffix.
#include <windows.h>/* ... */ #pragma comment (lib, "winmm")/ * Link with Windows multimedia lib */#pragma comment (lib, "Opengl32 ") /* Link with Microsoft OpenGL Lib */#pragma comment (lib," glu32 ")/ * link with OpenGL Utility Lib */< c9> #pragma comment (lib, "Glut32")/ * link with Win32 GLUT lib */
OpenGL Example GLSTRING.C test:
1#include <GL/glut.h>2#include <stdio.h>3 4 intMainintargcChar*argv[])5 {6Glutinit (&argc, argv);7Glutcreatewindow ("Test");8 ConstGlubyte *vendor, *renderer, *version, *EXTENSIONS;9VENDOR =glgetstring (Gl_vendor);Ten puts (VENDOR); OneRENDERER =glgetstring (gl_renderer); A puts (RENDERER); -VERSION =glgetstring (gl_version); - puts (VERSION); theEXTENSIONS =glgetstring (gl_extensions); - puts (EXTENSIONS); - return 0; -}
View Code
$ Tcc-lglut-run GLGETSTRING.C
Not to be continued ....
TCC Learning Notes (iii) use examples