使用Makefile进行交叉编译时使用了错误的包含

时间:2014-04-24 16:12:37

标签: c++ c linux makefile gcw0

我正在尝试为MIPS处理器编译audiofile库

这是我的配置命令:

./configure  --build i686-pc-linux-gnu --host mipsel-gcw0-linux-uclibc --prefix=/opt/gcw0-toolchain -target mipsel-gcw0-linux-uclibc

然后当我运行Make它包括我的计算机标题有时例如:

In file included from /opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/include/features.h:416:0,
                 from /usr/include/i386-linux-gnu/sys/types.h:25,
                 from ./../AudioFormat.h:26,
                 from Module.h:25,
                 from ModuleState.h:25,
                 from ModuleState.cpp:23:
/usr/include/i386-linux-gnu/bits/mathcalls.h:115:56: error: declaration does not declare anything [-fpermissive]
 __MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr)) __nonnull ((2));
                                                        ^
/usr/include/i386-linux-gnu/bits/mathcalls.h:115:56: error: declaration does not declare anything [-fpermissive]
 __MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr)) __nonnull ((2));
                                                        ^
/usr/include/i386-linux-gnu/bits/mathcalls.h:115:56: error: declaration does not declare anything [-fpermissive]
 __MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr)) __nonnull ((2));
                                                        ^
make[3]: *** [ModuleState.lo] Error 1
make[3]: Leaving directory `/root/Downloads/audiofile-0.3.6/libaudiofile/modules'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/root/Downloads/audiofile-0.3.6/libaudiofile'

我尝试在configure命令中使用所有不同的文件夹,但每次都会发生相同的错误

1 个答案:

答案 0 :(得分:1)

--build的{​​{1}}选项用于表示建筑环境,因为您正在进行交叉编译,因此您应该使用类似

的内容
configure

顺便说一句,在您的情况下,./configure --build mipsel-gcw0-linux-uclibc --host mipsel-gcw0-linux-uclibc ... 选项是不必要的,因为您没有构建编译器,链接器或类似的东西。