编译 C 代码,没有看到 #define'd 常量
我正在尝试在 QT Creator 中编译 8hz mp3 编码器 - C 代码。
在像这样开始的文件 l3psy.c 中,
#include <stdio.h>
#include "types.h"
#include "error.h"
#include "layer3.h"
#include "l3psy.h"
#include "fft.h"
#include "tables.h"
构建步骤抱怨 PI 在这里未声明
for(i=0;i<BLKSIZE;i++) window[i] = 0.5*(1-cos(2.0*PI*(i-0.5)/BLKSIZE));
,但是显然包含在内的 types.h 是这样开始的:
#ifndef TYPES_H
#define TYPES_H
#include <stdio.h>
#include <time.h>
#include "portableio.h"
#ifdef PI
#undef PI
#define PI 3.14159265358979
#endif
#define PI4 .78539816339745
#define PI64 .049087385212
因此,PI 无法未声明。
这里可能有什么问题?
另外,除了那个停止器之外,我还收到关于“函数中止的隐式声明”和“函数退出的隐式声明”和“内置函数'exit'的不兼容的隐式声明”的抱怨,但是,它们是 c 的标准函数,为什么会抱怨呢?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于第一个问题,关于
PI
,请参阅 Pascal Cuoq 的评论(仅此而已)。对于报告的隐式声明问题,您尚未包含这些函数的相关标头。 IIRC 声明。但检查一下。
exit
和abort
由干杯&呵呵,
For the first problem, about
PI
, see Pascal Cuoq's comment (that's all).For the problems with implicit declarations being reported, you haven't included the relevant header(s) for those functions. IIRC
exit
andabort
are declared by<stdlib.h
. But check it out.Cheers & hth.,