[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] delete function generates an error in movstat.h

From: Patrick Alken
Subject: Re: [Help-gsl] delete function generates an error in movstat.h
Date: Wed, 15 Aug 2018 14:40:15 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1


  Sorry for the slow reponse. The problem is that "delete" is a C++ keyword which g++ doesn't like in that header file. I always use gcc to compile so I didn't see this problem. Please edit your gsl_movstat.h header file and change "delete" to "delete_sample". Then try compiling your code.

I will make this update in the git repository also.


On 08/15/2018 02:25 PM, Montezano, Daniel wrote:
Hello there,

Just checking if anyone has come across a similar problem or if anyone has been 
able to reproduce the error with this code.

On my side, so far no luck. Have reinstalled everything and 
recompiled/reinstalled GSL and still the issue remains.

Thanks in advance for any help or suggestions.

Sent: Thursday, July 26, 2018 10:25 AM
To: address@hidden
Subject: Re: [Help-gsl] delete function generates an error in movstat.h

Hi Patrick,

Thanks for the reply.
The source code I am trying to compile follows below.

The file vector.dat contains the following list of numbers:
12, -20, 12, 24, 23, 8, -19, 9, -4, 2, 3, 4, 1, 7, 6, 7, 0, -1, -1, 2, 44, 1, 
-9, 7, 5, 5, 6, 6, 1, 1



----------BEGIN SOURCE CODE--------------------------------------
#include <stdio.h>
#include <iostream>
#include <stdlib.h>

#include <gsl/gsl_math.h>
#include <gsl/gsl_vector.h>
#include <gsl/gsl_movstat.h>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>

using namespace std;
int main(int argc, char** argv) {
     // window length
     const size_t K = 13;
     // time series length
     const size_t N = 30;

     // input time series
     gsl_vector *x = gsl_vector_alloc (N);
         FILE * f = fopen ("vector.dat","r");
         gsl_vector_fscanf (f,x);
         fclose (f);

     // output mean time series
     gsl_vector *xmean = gsl_vector_alloc(N);
     // workspace for the rolling computation
     gsl_movstat_workspace * wkspc = gsl_movstat_alloc (K);

     // compute the rolling mean for a gsl_vector
     gsl_movstat_mean (GSL_MOVSTAT_END_PADZERO, x, xmean, wkspc);

     // important to free these things to prevent crashes
     gsl_movstat_free (wkspc);

     return 0;
---------------------- END SOURCE CODE---------------------

Can you provide your source code?

On 07/13/2018 07:31 PM, Daniel wrote:

I am trying to compile an example from the docs. Compute a rolling mean using
the new package Moving Window Statistics.

My code is producing the following error (Windows 10, GCC-6.3.0-1,
GSL 2.5):

g++ gsl_rolling_stats.cpp -lgsl -o gsl_rolling_stats.exe
  In file included from gsl_rolling_stats.cpp:11:0:
  c:\documents\progrs\mingw32\include\gsl\gsl_movstat.h:58:9: error: expected
  unqualified-id before 'delete'
  int (*delete) (void * vstate);
  c:\documents\progrs\mingw32\include\gsl\gsl_movstat.h:58:9: error: expected
  ')' before 'delete'
I compiled GSL compiled from source using MinGW and msys. I have tested my
GSL installation with other GSL code and everything is working fine.

I appreciate any help.

Thank you!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]