On Tue, 14 Sep 2010, Joel Bycraft wrote:
Just as a follow-up, I determined there are more issues
regarding compatibility with C++, which is why I could not get a
pointer returned on gretl_model_get_matrix. It's not as simple
as just using extern "C" {} when compiling the headers as I
first thought. It's only regarding specific gretl features,
though.
I'm attaching a simple cpp test file which estimates a model using
the lsq() function and retrieves a matrix from it. (It also does
OLS via matrix methods.) I built the program with
g++ -g -O2 -Wall `pkg-config --cflags gretl` -o gretltest \
gretltest.cpp `pkg-config --libs gretl`
and ran it as
./gretltest ~/src/share/data/data4-1.gdt
No errors; matrix retrieved OK. Perhaps you can tell me how your
case differs.
Allin Cottrell