首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

初学者,刚自学linux上C编程,请问一个编译有关问题

2012-09-01 
菜鸟,刚自学linux下C编程,请教一个编译问题本人是一个菜鸟,刚自学linux下C编程,问题有点弱,大家别见笑。下

菜鸟,刚自学linux下C编程,请教一个编译问题
本人是一个菜鸟,刚自学linux下C编程,问题有点弱,大家别见笑。
下面是我编译一个C程序出现的warning,我看不太懂,请高手指点,谢谢!
In file included 
 from ../../../../../External/a.h:25,
 from ../../../../../C_Application/b.h:23,
 from ../../../../../C_Application/cated.c:58:
../../../../../E_External/c.h: In function ‘Set’:
../../../../../External/d.h:11: warning: implicit declaration of function ‘_lmbd’
../../../../../C_Application/cated.c: In function ‘offset’:
../../../../../C_Application/cated.c:13: warning: implicit declaration of function ‘_pack2’
上面这一段是什么意思啊:
1.In file included from是什么意思?
2.../../../../../是什意思,我知道../是返回上层目录,那么多我就有点懵了
3.from ../../../../../C_Application/cated.c:58:为什么这里c:58后面是“:”不是from了?下面的In function ‘offset’和../../../../../C_Application/cated.c:13后面为什么都是“:”

[解决办法]
大体给你说一下:
In file included 这是告诉你在你包含的其它文件中出了问题,也就是在你程序的开头用#include <>这个包含的其它文件出了问题

 from ../../../../../External/a.h:25,
from ../../../../../C_Application/b.h:23,
from ../../../../../C_Application/cated.c:58: 这三行是告诉你在你包含或是用到的a.h的25行,b.h的23行,cated.c的58行有问题。一个../表示往上返回一级目录../../这就表示往上返回两级,../../../../../External/a.h这个就表示往上返回5次,在这个目录下有个External,在External下有个a.h.

../../../../../E_External/c.h: In function ‘Set’: 这里是告诉你c.h里面的Set函数出了问题
../../../../../External/d.h:11: warning: implicit declaration of function ‘_lmbd’这里是说在d.h的11行有一个警告,也就是使用的不合理
../../../../../C_Application/cated.c: In function ‘offset’:这里是cated.c的offset函数有问题
../../../../../C_Application/cated.c:13: warning: implicit declaration of function ‘_pack2’这里是cated.c的13行有警告

编译器只能告诉你大体上是哪个地方出了问题,可能的问题是什么,具体到底是哪里出了问题,还要你自己看
[解决办法]

C/C++ code
In file included   from ../../../../../External/a.h:25, from ../../../../../C_Application/b.h:23, from ../../../../../C_Application/cated.c:58:  //../../../../  上一层目录的上一层目录的上一层目录../../../../../E_External/c.h: In function ‘Set’:   //c.h文件里"Set"函数里面../../../../../External/d.h:11: warning: implicit declaration of function ‘_lmbd’//_lmbd函数隐式申明了../../../../../C_Application/cated.c: In function ‘offset’: ../../../../../C_Application/cated.c:13: warning: implicit declaration of function ‘_pack2’//cate.c文件的13行  你可以自己翻译下,大哥。 

热点排行