linking failure

来源:百度知道 编辑:UC知道 时间:2024/06/17 17:04:56
简答题:
why is a linker needed in C programming? Give an example of a linking failure.

我们可以把编译过程分为两步:
1.狭义的编译,将C源代码翻译成二进制机器指令的目标文件
2.链接过程,对所有的C源代码对应的目标文件进行链接,从而组织成一个在当前系统中可运行的二进制文件。

链接错误有很多,常见的如:
在源代码中声明并调用了某个函数,但是在工程中并未实现此函数,那么在链接时会给出一个 undefined symbol的错误。

how?the sourcecode you write is just a txt file.but to the operation system it can execute the file write with 0 or 1.when you write a c program,the compiler will import the head file ,that is link!