gpt4 book ai didi

gcc - GCC编译产生此处未声明的 “real.h:53: error: ' SIZEOF_LONG'(不在函数中)”

转载 作者:行者123 更新时间:2023-12-02 10:45:36 25 4
gpt4 key购买 nike

我正在尝试在运行Linux 2.6.31.8 armv5tel的Buffalo LinkStation Pro Duo(在unlocking之后)上编译GCC 4.7.2。

不幸的是,make会引发很多错误,从

gcc -c  -DIN_GCC_FRONTEND -g -fkeep-inline-functions -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-formIn file included from ../../gcc-4.7.2/gcc/tree.h:32,
from ../../gcc-4.7.2/gcc/c-lang.c:27:
../../gcc-4.7.2/gcc/real.h:53: error: 'SIZEOF_LONG' undeclared here (not in a function)
In file included from ../../gcc-4.7.2/gcc/tree.h:32,
from ../../gcc-4.7.2/gcc/c-lang.c:27:
../../gcc-4.7.2/gcc/real.h:87:5: error: division by zero in #if
../../gcc-4.7.2/gcc/real.h:87:5: error: division by zero in #if
../../gcc-4.7.2/gcc/real.h:90:6: error: division by zero in #if
real.h的第53行读取 unsigned long sig[SIGSZ];,其中 SIGSZ在第40行定义为 #define SIGSZ (SIGNIFICAND_BITS / HOST_BITS_PER_LONG)而第87行是 #if REAL_WIDTH == 1,其中 REAL_WIDTH从第72行开始定义为 #define REAL_WIDTH \

(REAL_VALUE_TYPE_SIZE/HOST_BITS_PER_WIDE_INT \

+ (REAL_VALUE_TYPE_SIZE%HOST_BITS_PER_WIDE_INT ? 1 : 0)) /* round up */

这似乎归结为 HOST_BITS_PER_*为零。我是否必须使用 configure参数手动定义它们,或者如何解决此问题?

更新
config.log包含以下错误:
conftest.c:10:19: error: ppl_c.h: No such file or directory
conftest.c: In function 'main':
conftest.c:16: error: 'choke' undeclared (first use in this function)
conftest.c:16: error: (Each undeclared identifier is reported only once
conftest.c:16: error: for each function it appears in.)
conftest.c:16: error: expected ';' before 'me'
configure:5708: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define LT_OBJDIR ".libs/"
| /* end confdefs.h. */
| #include "ppl_c.h"
| int
| main ()
| {
|.
| #if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR < 11
| choke me
| #endif
|.
| ;
| r

this post之后,我似乎已经忘记安装 ppl了,我现在将尝试

最佳答案

SIZEOF_LONG应该是#define文件中configureauto-host.h d。您的auto-host.h应该包含以下内容:

/* The size of `long', as computed by sizeof. */
#ifndef USED_FOR_TARGET
#define SIZEOF_LONG 8
#endif

如果上述内容不存在(看起来确实如此),请检查 config.log是否存在错误。搜索字符串 checking size of long周围的错误。

关于gcc - GCC编译产生此处未声明的 “real.h:53: error: ' SIZEOF_LONG'(不在函数中)”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13857250/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com