在main.c里面我没有看到#include "AA.h"。但是发现可以编译连接

- UID
- 806177
|
在main.c里面我没有看到#include "AA.h"。但是发现可以编译连接
codeWarrior的一个project,我只看到AA.c文件里包含AA.h头文件,AA.c里面定义了test()函数。在main.c里面我没有看到#include "AA.h"。但是发现可以编译连接。真是搞不懂为什么?请指点。 |
|
|
|
|
|
 
- UID
- 522025
- 性别
- 男
|
编译肯定能过的,但是链接的时候会有个警告而不会报错。test函数会在链接重定位的时候会分配到一个地址,main只够得到这个地址,所以不会报错,而且能够正常运行。但是如果test带参数的话,在编译main的时候不会生成对应汇编来传递参数,会导致问题。 |
|
|
|
|
|