|
|
为了生成一个最终的可执行文件,就需要一些目标文件,也就是需要C文件,而这些C文件中又需要一个main函数作为可执行程序的入口,那么我们就从一个C文件入手,假定这个C文件内容如下:
+ Z x3 O5 R8 x, C: \# h#include <stdio.h>
) s* t* K/ O% Y#include "mytest.h "
* k. c% I8 H1 r" S9 C ?* B, H
t' e% K6 P y6 T( U) ]1 `int main(int argc,char **argv)+ v, y* K: C6 i, z' A6 ]: U5 G
{
( [. V' k4 J8 W* b: ]$ b; \ _test = 25;
3 p4 A8 \+ m& s# y9 ]# |printf( "test.................%d\n ",test);4 ~' a) i5 j9 d& w
}2 @) ]) Y3 \* A8 L
) u4 x# L& z9 o2 |9 k" H
头文件内容如下:1 | J+ P( U) T
int test;
# }7 T# ?/ D1 I e9 Y0 x$ x8 Z& ~4 | |
|