文件math.h编译错误:预期前声明说明符或'...''(' [英] math.h compilation error: expected declaration specifiers or '...' before '('

查看:930
本文介绍了文件math.h编译错误:预期前声明说明符或'...''('的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图编译一个相当大的项目。一对夫妇的文件包括math.h中我得到的编译错误是:

I'm trying to compile a fairly large project. A couple files include math.h. The compilation error I'm getting is:

"In file included from math.h:71:0,

mathcalls.h:310:1: error: expected declaration specifiers or '...' before '(' token"

我知道我的数学头没有被改变,他们包括罚款与一个Hello数学世界的节目我只是写了,所以我不知道是什么问题。在被给予错误的mathcalls.h文件中特定行

I know my math headers have not been changed and they include fine with a "hello math world" program I just wrote, so I'm not sure what the problem is. THe specific line in the mathcalls.h file that is giving the error is

/* Round X to nearest integral value, rounding halfway cases away from
   zero.  */
__MATHCALLX (round,, (_Mdouble_ __x), (__const__));

任何线索的问题是什么吗?

Any clue what the problem is here?

推荐答案

您定义的圆形包括前<文件math.h> 。事情是这样的:

You defined round before including <math.h>. Something like this:

#define round(x) trunc((x+0.5))
#include <math.h>

编译高于code。与GCC-4.6.2打印以下错误:

Compiling the above code with gcc-4.6.2 prints the following error:

In file included from /usr/include/math.h:71:0,
                 from a.c:2:
/usr/include/bits/mathcalls.h:310:1: error: expected declaration specifiers or '...' before '(' token

这篇关于文件math.h编译错误:预期前声明说明符或'...''('的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆