error: ‘PATH_MAX’ undeclared (first use in this function)

2puT發表於2016-07-08

Ubuntu下 make menuconfig使用必須安裝一個庫

apt-get install libncurses5-dev

否則提示錯誤。

>> Unable to find the Ncurseslibraries. 
>> 
>> You must install ncurses-devel inorder 
>> to use 'make menuconfig' 

make[2]: *** [scripts/lxdialog/ncurses] 錯誤1 
make[1]: *** [menuconfig] 錯誤 2 
make: *** [menuconfig] 錯誤 2 

Ubuntu 11.10環境下,編譯PowerPC系統核心出錯

核心2.6.19交叉編譯問題,描述如下:

scripts/mod/sumversion.c: In function‘get_src_version’: 
scripts/mod/sumversion.c:384: error: ‘PATH_MAX’ undeclared (firstuse 
in this function) 
scripts/mod/sumversion.c:384: error: (Each undeclared identifieris 
reported only once 
scripts/mod/sumversion.c:384: error: for each function it appearsin.) 
scripts/mod/sumversion.c:384: warning: unused variable‘filelist’ 
make[3]: *** [scripts/mod/sumversion.o] Error1 
make[2]: *** [scripts/mod] Error 2 
make[1]: *** [scripts] Error 2 
make[1]: Leaving directory`/home/nios2/uClinux-dist/linux-2.6.x' 
make: *** [linux] Error 1

 

解決方法:

# vi scripts/mod/sumversion.c

標頭檔案包含中檢視是否有limits.h,若沒有,包含進去即可

#inlcude

相關文章