linux 第1个参数时在不兼容的指针类型间转换,警告:从不兼容的指针类型传递参数[默认启用]...

我一直在寻找其他线程与某些有关的,但不知何故,我只是不明白…

我想对我已经评估的一组值做一些FFT,并写这个程序来首先读取值并将它们保存到大小为n的数组.

int main () {

// some variables and also a bit of code to read the 'messwerte.txt'

printf("Geben sie an wieviele Messwerte ausgelesen werden sollen: ");

scanf("%d",&n);

double werte[n]; //Array der "fertigen" Messwerte

in = fopen ("messwerte.txt","r");

double nul[n]; //Array von nullen

int logN = 14;

l=FFT(logN,&werte,&nul);

}

在同一个文件中,我也在这个程序的帮助下做FFT:

double FFT (int logN,double *real,double *im) //logN is base 2 log(N) {

// blabla FFT calculation

}

但是,当我编译我总是得到这个错误:

gcc FFT.c -lm

FFT.c: In function ‘main’:

FFT.c:94:2: warning: passing argument 2 of ‘FFT’ from incompatible pointer type [enabled by default]

FFT.c:4:8: note: expected ‘double *’ but argument is of type ‘double (*)[(unsigned int)(n)]’

FFT.c:94:2: warning: passing argument 3 of ‘FFT’ from incompatible pointer type [enabled by default]

FFT.c:4:8: note: expected ‘double *’ but argument is of type ‘double (*)[(unsigned int)(n)]’

既然这是我第一次编程,我真的不知道我的代码有什么问题.我必须为编译器或类似的东西设置更多的标志(因为我不得不做这个-lm的东西,或者它不会编译,并且说如pow没有找到的东西)?

此外,我知道在Windows或Linux机器上编写时可能会有所区别,如果是操作系统的问题,我使用的是Linux,Lubuntu 12.10 32位.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值