交叉编译错误

时间:2012-10-17 15:22:43

标签: cross-compiling

我尝试交叉编译要在arm目标上运行的应用程序(我的主机是x86 ubuntu 11.10)。

当我运行“make”时,我得到了这个错误:

mar@ubuntu:~/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 for arm,但我不知道如何。

对于makefile,我使用那些编译器。

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

1 个答案:

答案 0 :(得分:1)

您需要为您要交叉编译的体系结构提供libGL.a

要做到这一点,请发现SDK中是否有libGL.a或者是否在其他地方获取,然后使用选项-L/path/to/your/arm/libs/dir-I/path/to/your/arm/headers也会有帮助)。

要避免在本机(主机)目录中搜索,请使用-nostdlib-nostdinc(对于GCC / G ++)