Quand je lance le code suivant;

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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
 
#include <fftw3.h>
#include <stdlib.h>
 
#define N 1024
#define DEMI_PER 16
#define AMPLITUDE 5
 
void show_signal(double * in, unsigned long size)
{
  unsigned long i;
 
  for( i = 0 ; i < size ; i++ )
    {
      fprintf(stdout," %f \n",in[i] );
    }
}
 
void show_fftw_complex(fftw_complex * in, unsigned long size)
{
  unsigned long i;
 
  for( i = 0 ; i < size ; i++ )
    {
      fprintf(stdout,"%f \n",in[i][0]);
    }
}
 
int main ( int argc, char **argv)
{
  double *in;
  unsigned long i,j = 0;
  fftw_complex * out;
  fftw_plan p;
 
  in = malloc( N * sizeof(double));
  out = fftw_malloc( N * sizeof(fftw_complex));
 
  /* Initialisation du plan de calcul pour la fft */
  p = fftw_plan_dft_r2c_1d(N,in,out,FFTW_ESTIMATE);
 
  /* Création d'un signal pseudo rectangle */
  for( i = 0 ; i < N ; i++)
    {
      if( i % DEMI_PER == 0 )
	{
	  if ( j == AMPLITUDE )
	    j = 0;
	  else
	    j = AMPLITUDE;
	}
      in[i] = j;
    }
 
  /* Affiche le signal d'entrée */
  show_signal(in,N);
 
  /* Calcule la fft */
  fftw_execute(p);
 
  /* Affiche la TF du signal d'entrée */
  show_fftw_complex(out,N/2);
 
  fftw_destroy_plan(p);
  free(in);
  fftw_free(out);
 
  return EXIT_SUCCESS;
 
}

j'ai un message d'erreur, qui est :
>.\MAIN.CPP(36) : error C2440: '=' : cannot convert from 'void *' to 'double *'
1> Conversion from 'void*' to pointer to non-'void' requires an explicit cast
1>.\MAIN.CPP(37) : error C2440: '=' : cannot convert from 'void *' to 'fftw_complex (*)'
Qu'est ce que cela signifie et comment résoudre.
merci.