Hi again,

Found a solution. Seems you have to specifically specify that the forecast functions are C (when compiling with a C++ compiler). Added this to the top of my file:

extern "C"
{
    void free_fit_resid (FITRESID *fr);
    FITRESID *get_fit_resid (const MODEL *pmod, const DATASET *dset, int *err);
    FITRESID *get_forecast (MODEL *pmod, int t1, int t2, int pre_n, DATASET *dset, gretlopt opt, int *err);
    FITRESID *get_system_forecast (void *p, int ci, int i, int t1, int t2, int pre_n, DATASET *dset, gretlopt opt, int *err);
    int do_forecast (const char *str, DATASET *dset, gretlopt opt, PRN *prn);
    void forecast_options_for_model (MODEL *pmod, const DATASET *dset, int *flags, int *dt2max, int *st2max);
    gretl_matrix *get_forecast_matrix (int idx, int *err);
    FITRESID *rolling_OLS_k_step_fcast (MODEL *pmod, DATASET *dset, int t1, int t2, int k, int pre_n, int *err);
    void fcast_get_continuous_range (const FITRESID *fr, int *pt1, int *pt2);
    void forecast_matrix_cleanup (void);
}
#include <forecast.h>

Chris

On 2014/03/29 10:28 AM, GOO Creations wrote:
Hi,

I'm trying to estimate the parameters for an ARMA model and then forecast the next value. I've linked the library (libgretl-1.0) to my program and am able to create datasets and estimate the ARMA model. I'm however unable to use the forecast code.

I've noticed that forecast.h is not included in libgretl.h, which seems strange. So I manually added forecast.h to my program. I now get undefined references to all the functions in forecast.h. So I assume the forecast functionality is not part of the libgretl-1.0 library. Which library should I link to, to make use of this functionality? I've tried linking all the libs in /usr/lib/gretl-gtk2, but that didn't help either.

Any help would be appreciated

Chris