1. 程式人生 > >編譯libjpeg-9a時,竟找不到jconfig.h

編譯libjpeg-9a時,竟找不到jconfig.h

1、用交叉編譯器編譯時,找不到jconfig.h標頭檔案:

In file included from libjpeg/jpeg-9a/jaricom.c:17:0:
libjpeg/jpeg-9a/jinclude.h:20:55: fatal error: jconfig.h: No such file or directory
compilation terminated.
make: *** [libjpeg/jpeg-9a/jaricom.o] 錯誤 1

2、檢視程式碼檔案,在jconfig.txt中,描述如下:

 * The actual configuration options for a particular installation are stored
 * in jconfig.h.  On many machines, jconfig.h can be generated automatically
 * or copied from one of the "canned" jconfig files that we supply.  But if
 * you need to generate a jconfig.h file by hand, this file tells you how.
 *
 * DO NOT EDIT THIS FILE --- IT WON'T ACCOMPLISH ANYTHING.
 * EDIT A COPY NAMED JCONFIG.H.
 */

3、我用的是ubuntu系統,在視窗下複製一個副本,然後改名,再編譯,錯誤依舊。。。。

有點灰心,不知為什麼,然後新建text.h,可以正確包含; 將text.h改名jconfig.h,正常; 將jconfig.txt內容複製到jconfig.h中,編譯OK。

仔細回顧下,感覺是檔案許可權什麼的不對,ls -l  :

4、仔細觀察,jconfig_.h(第一次複製的標頭檔案)前面竟然有一個空格。。。。。