Http://www.vcworld.net/news/200911/091956.html
1. Now we have created two functions sub1 () and sub2 () into a function library file named mylib. Lib. The functions and parameters of the two functions are as follows: void sub1 (void); float sub2 (int I, float X) create a file named s1.c and s2.c respectively, run the TCC command to decompile them and generate two target files, s1.obj and s2.obj. Finally, run the tlib command to create the library file mylib. lib, and create the corresponding example Table file (the example Table file is mainly used to check the usage of the main function library). The command format is as follows:
TCC s1.c s2.c
Tlib mylib + S1 + S2, mylib. lst
Copy the generated mylib. Lib library file to the C: cLib directory of the standard library.
2. Create the initial document (assuming the name is myfunc. h) as follows:
Extern void sub1 (void );
Extern float sub2 (INT, float );
Copy the file to the C: cinclude directory.
3.ProgramIn the following example:
# Include <myfunc. h>
Main ()
{...
Call sub1 (), sub2 ();
...
}
4. Use the compile command TCC under turboc to edit and link the user program file and set the user program file name to my. C. Use the command format:
TCC-ic: cinclude