Bonjour,

voici le code de lafonction fft d'aprés Numerical Recipies:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
 
#include<math.h>
#define SWAP(a,b) tempr=(a); (a)=(b); (b)=tempr
 
void fft(float data[],unsigned long nn,int isign)
{
unsigned long n,mmax,m,j,istep,i;
double wtemp,wr,wpr,wpi,wi,theta; //Double precision forthet rigonomet-ricrecurrences.
float tempr,tempi;
n=nn<<1;
j=1;
for(i=1;i<n;i+=2)
{
if(j>i)
{
SWAP(data[j],data[i]);
SWAP(data[j+1],data[i+1]);
}
m=n>>1;
while(m>=2&&j>m)
{
j-=m;
m>>=1;
}
j+=m;
}
 
mmax=2;
while(n>mmax){
 
istep=mmax<<1;
theta=isign*(6.28318530717959/mmax);
wtemp=sin(0.5*theta);
wpr=-2.0*wtemp*wtemp;
wpi=sin(theta);
wr=1.0;
wi=0.0;
for(m=1;m<mmax;m+=2){
for(i=m;i<=n;i+=istep){
j=i+mmax; tempr=wr*data[j]-wi*data[j+1];
tempi=wr*data[j+1]+wi*data[j];
data[j]=data[i]-tempr;
data[j+1]=data[i+1]-tempi;
data[i]+=tempr;
data[i+1]+=tempi;
}
wr=(wtemp=wr)*wpr-wi*wpi+wr;
wi=wi*wpr+wtemp*wpi+wi;
}
mmax=istep;
}
}
le problème est que quand je compile ça me donne :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
Project   : Console application
Compiler  : GNU GCC Compiler (called directly)
Directory : D:\essaye3\
--------------------------------------------------------------------------------
Compiling: ..\essaye2\main.c
Linking console executable: ..\essaye2\main.exe
C:\Program Files\CodeBlocks\lib/libmingw32.a(main.o):main.c:(.text+0x106): undefined reference to `WinMain@16'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 9 seconds)
0 errors, 0 warnings
où est l'erreur ?