This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

对于DSP2808关于全部变量定义位置与.ebss的关系



我如果在commsci.c中定义了一个全局变量,在main.c中通过extern声明后使用,这样的话编译器会报.ebss空间不足,而如果我在.h中定义,在另一个.h中声明extern,在通过包含头文件的方式来引用外部变量,则不会出现错误。

我想全局变量的话编译器应该都是分配一个地址,为什么这两种情况对.ebss的空间占用却不同呢?