移植qt之交叉編譯tslib 1 4

2021-06-12 18:53:21 字數 1591 閱讀 3015

#export prefix=/path_to_your_tslib_1.4_dir

#export cc=/path/to/your/cross-compiler-bin-dir

/*autogen.sh is an important .sh file,it produce ./configure file according to current env setting

*/#./autogen.sh

錯誤現象:./autogen.sh: 9:

autoreconf:

notfound

解決辦法:#sudo apt-get install autoconf

錯誤現象:can't exec "automake": 沒有該檔案或目錄 at /usr/bin/autoreconf line 183

解決辦法:#sudo apt-get install automake

錯誤現象:

configure.ac:25:

error:

possibly

undefined

macro:

ac_disable_static

解決辦法:#sudo apt-get install libtool

#echo "ac_cv_func_malloc_0_nonnull=yes" >arm-none-linux-gnueabi.cache

/*(it is better to see what parameter that the ./configure program take,use "./configure --help")

*you can add "--enable-debug"([default=no]),and/or "--enable-static"([default=no])

*/#./configure --host=arm-none-linux-gnueabi --prefix=$prefix --cache-file=arm-none-linux-gnueabi.cache

#make

錯誤:undefined reference to rpl_malloc

解決辦法(2種):

* configure的時候加上--with-gnu-ld這個引數

* 或者在config.h裡加上#undef rpl_malloc

#make install

或者在當前目錄查詢了rpl_malloc,發現configure裡有#define malloc rpl_malloc一行。分析configure指令碼相關的**,原來是ac_cv_func_malloc_0_nonnull引起的,ok我們不讓它檢查了,產生乙個cache檔案arm-linux.cache,欺騙configure:

[root@linux tslib]# echo "ac_cv_func_malloc_0_nonnull=yes" >$ arch -linux.cache

[root@linux tslib]# ./configure --prefix=$(rootfs_dir)/usr --host=$ arch -linux --cache-file=$ arch -linux.cache

配置成功後,重新編譯一下,ok!

CMake之交叉編譯

一 引言 很多時候,我們在開發的時候是面對嵌入式平台,因此由於資源的限制需要用到相關的交叉編譯。即在你host宿主機上要生成target目標機的程式。裡面牽扯到相關標頭檔案的切換和編譯器的選擇以及環境變數的改變等,我今天僅僅簡單介紹下相關cmake在面對交叉編譯的時候,需要做的一些準備工作。二 cm...

Linux之交叉編譯

交叉編譯 在乙個平台上生成另乙個平台的可執行 編譯 是在乙個平台上生成該平台的可執行程式 為什麼要交叉編譯 有的平台上不允許或者不能夠安裝我們所需要的編譯器比如c51。因為目的平台上的資源匱乏,無法執行我們所需要的編譯器。樹莓派是不是就不需要交叉編譯?錯。也要,樹莓派有時又是因為目的平台還沒建立,連...

樹莓派之交叉編譯

1 為什麼要使用交叉編譯 交叉編譯工具較快開發的速度。樹莓派中已經安裝了gcc工具鏈,可在樹莓派中直接編譯源 生成可執行檔案。於此同時,pc機上也可使用gcc工具鏈生成可執行 但是和樹莓派上的gcc工具不同,pc機上的gcc工具生成intel或amd晶元上可執行的 但樹莓派卻是arm系列的晶元,顯然...