2012-10-17 168 views
0

我嘗試交叉編譯應用程序以運行在arm目標上(我的主機是x86 ubuntu 11.10)。交叉編譯錯誤

當我運行「make」

,我得到這個錯誤:

[email protected]:~/Desktop/App$ make 
cc1plus: warning: include location "/usr/include/GL/" is unsafe for cross-compilation 
cc1plus: warning: include location "/usr/include/c++/4.6/" is unsafe for cross-compilation 
cc1plus: warning: include location "/usr/include/qt4/" is unsafe for cross-compilation 
.. 
/usr/include/qt4/QtOpenGL/qgl.h:77:15: fatal error: GL: No such file or directory 
compilation terminated. 
make: *** [main.o] Error 1 

我知道,我需要交叉編譯我的librairies QT4和OpenGL的手臂,但我不知道怎麼辦。

對於makefile我使用這些編譯器。

CC = arm-none-linux-gnueabi-gcc 
CXX = arm-none-linux-gnueabi-g++ 
AR = ar 

回答

1

您需要爲您正在交叉編譯的架構提供libGL.a

要做到這一點,請發現您SDK中是否有libGL.a或將它拿到別的地方,然後使用選項-L/path/to/your/arm/libs/dir(同樣-I/path/to/your/arm/headers會有幫助)。

爲了避免在本地搜索(主機)的目錄,請使用-nostdlib-nostdinc(爲GCC/G ++)

+0

它可以幫助我。但是,如果我想用'PKG-config'沒有外部提供包括與庫。我怎樣才能做到這一點? –