首先聲明 :這是我借鑒別人聯合自己的交叉編譯經驗做改動而來的

              1。# tar zxvf sqlite-3.3.7.tar.gz

          #cd /usr/local/arm-linux/sqlite-3.3.7

          新建一個sqlite-arm-linux目錄

              2.# mkdir /usr/local/arm-linux/sqlite-arm-linux

              3.# cd /usr/local/arm-linux/sqlite-arm-linux

              # export PATH=/usr/local/arm-linux/bin:$PATH


              4.#../sqlite-3.3.7/configure --host=arm-linux --prefix=/usr/local/arm-linux/sqlite-arm-linux

          這部會出現下面的錯誤:


          configure: error: unable to find a compiler for building build tools


          這個錯誤的解決方法是:


          首先,我們進入目錄usr/local/arm-linux/sqlite-1.3.7,打開其中的configure文件,用查找功能找到下列語句:

              (用 test "$cross_compiling" = yes &&進行搜索)
          # test "$cross_compiling" = yes &&

          # { { echo "$as_me:13264: error: cannot check for file existence when cross compiling" >&5

          #echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}

          # { (exit 1); exit 1; }; }

          把其中的{ (exit 1); exit 1; }; }改為 { (echo 1); echo 1; }; }

          一共有兩處,都改過來。


          然后,我們要設置config_TARGET_CC和config_BUILD_CC兩個環境變量。config_TARGET_CC是交叉編譯器,config_BUILD_CC是主機編譯器。重來:

          #export config_BUILD_CC=gcc

          #export config_TARGET_CC=arm-linux-gcc

          下面重新編譯就可以了

          #../sqlite-3.3.7/configure --host=arm-linux --prefix=/usr/local/arm-linux/sqlite-arm-linux

          然后我們會發現在在/usr/local/arm-linux/sqlite-arm-linux目錄下生成一些相關文件: config.log config.status libtool Makefile sqlite3.pc

           如果:還是出現如下同樣的錯誤
          checking for /usr/include/readline.h... configure: error: cannot check for file existence when cross compiling

            那么 首先 : 你檢查你的交叉編譯環境 錯誤?? 如果真的沒有則安裝readline.h 在ubuntu的軟件中心查找libncurses5-dev libreadline5-dev進行安裝

                  如果安裝之后從新。/conigure還是有這個錯誤 那就不管了 我不知道了但是還是生成了makefile文件!


          下面在make之前我們修改一下Makefile文件,把其中的BCC = arm-linux-gcc -g -O2 為 BCC = gcc -g -O2
          #make

          #make install

          會出現這樣的話語:libsqlite3.so.0.8.6: ELF 32-bit LSB shared object, ARM, version 1 (ARM), not stripped

                  over !!!

           

          posted on 2012-04-18 09:37 姚先進 閱讀(1996) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
           
          主站蜘蛛池模板: 宜章县| 桐柏县| 东丽区| 凤阳县| 寻乌县| 镇康县| 旬阳县| 正镶白旗| 芦山县| 故城县| 佛学| 庆元县| 孝感市| 巴东县| 焦作市| 高安市| 衢州市| 喀喇沁旗| 天长市| 林口县| 临西县| 聂荣县| 莱阳市| 前郭尔| 阳东县| 鄂托克旗| 临夏县| 鄂州市| 囊谦县| 吉安市| 象州县| 景泰县| 龙江县| 丰顺县| 洛隆县| 伊宁市| 新闻| 定兴县| 凤山市| 新源县| 永寿县|