c++ - :0:8: 错误:一个声明中有多种类型
问题描述
当我尝试在 CentOS 7.5 中执行语法服务器代码(包含 c 和 c++ 文件)时,我遇到了以下错误
获得错误:
[command-line]:0:8: error: multiple types in one declaration
[command-line]:0:8: error: declaration does not declare anything `enter code here`[-fpermissive]
[command-line]:0:7: error: multiple types in one declaration
[command-line]:0:7: error: declaration does not declare anything [-fpermissive]
In file included from /usr/include/_G_config.h:15:0,
from /usr/include/libio.h:32,
from /usr/include/stdio.h:74,
from jsapi.h:47,
from jsatom.h:47,
from jscntxt.h:59,
from jsanalyze.h:45,
from jsanalyze.cpp:40:
jsfun.h: In static member function ‘static uintN JSFunction::offsetOfNativeOrScript()’:
jsfun.h:230:37: warning: invalid access to non-static data member ‘JSFunction::u’ of NULL object [-Winvalid-offsetof]
return offsetof(JSFunction, u.nativeOrScript);
^
jsfun.h:230:37: warning: (perhaps the ‘offsetof’ macro was used incorrectly) [-Winvalid-offsetof]
In file included from /usr/include/time.h:37:0,
from prmjtime.h:46,
from jscntxt.h:75,
from jsanalyze.h:45,
from jsanalyze.cpp:40:
jscntxt.h: In function ‘JSContext* js_ContextFromLinkField(JSCList*)’:
jscntxt.h:2963:64: warning: invalid access to non-static data member ‘JSContext::link’ of NULL object [-Winvalid-offsetof]
return (JSContext *) ((uint8 *) link - offsetof(JSContext, link));
^
jscntxt.h:2963:64: warning: (perhaps the ‘offsetof’ macro was used incorrectly) [-Winvalid-offsetof]
make[1]: *** [jsanalyze.o] Error 1
我无法弄清楚问题所在。任何人都可以帮我解决这个问题吗?谢谢你
解决方案
通过安装 spiderMonkey 完成 autoconf-2.13 后,上述错误得到解决。有关安装的更多信息,请参阅以下站点: https ://wiki.apache.org/couchdb/Installing_SpiderMonkey 。
推荐阅读
- iframe - Yii2 错误请求 400 - 无法从另一个域的 iframe 登录
- python - 打印使用函数调用存储的输入
- c# - SignalR 可以包含控制器逻辑并执行 CRUD 操作吗?
- r - 如何合并R中频率表上的属性?
- excel - VBA:如何将所需格式的文本传递到不同的单元格
- html - 具有更大或更短文本的 div 中的宽度相同
- tsql - 如何根据 CASE 逻辑更新表?
- c++ - 是 std::chrono::duration 默认初始化为 0
- python - Conda 没有看到已安装的模块
- python-3.x - 如何使用 Python 和 ask-sdk(意图链接)将意图委托给 Alexa?