|
|
为了生成一个最终的可执行文件,就需要一些目标文件,也就是需要C文件,而这些C文件中又需要一个main函数作为可执行程序的入口,那么我们就从一个C文件入手,假定这个C文件内容如下:
4 D6 e W0 t* H5 U. q) k4 v#include <stdio.h>
0 Q- h* c5 |( ] E#include "mytest.h "
M/ {1 r/ @5 W2 ]& B& q; R, ]& H ?6 ?) [
int main(int argc,char **argv)
3 U" d( h1 w# b{
! a( z ]' R. o3 c1 h- ]/ Vtest = 25;
; f% O* [1 g* Q0 n2 f5 J- N$ I( \3 ~printf( "test.................%d\n ",test);
3 a5 X* P, |( ~5 e}
3 C4 ^3 X% a3 ~! o& k* I3 l" I* ?4 b1 A; f+ ^0 a2 x
头文件内容如下:) r7 E4 j l6 S/ l; y8 A: E
int test;& V p1 T& n5 n* B0 Q) l
|
|