[Gretl-users] Using the libgretl shared library in C++

Ganguly, Sunandan sunandan.ganguly at credit-suisse.com
Thu Apr 30 15:11:22 EDT 2009


Hi,

Has anyone out there ever tried to use the api-s within the shared
library from inside a C++ program? If yes, I'd like to hear about your
experience with compiling and linking your program. I have spent the
last two days trying to  build an app where I want to use some basic
regression, but I cant even get past the build stage. 

I get this linker error :

/app/devtools/gcc-4.3.3/bin/g++ -m64 -mtune=opteron -lpthread  Main.o
-L/app/devtools/gretl-1.8.0.org/lib -lgretl-1.0
-L/app/devtools/zlib-1.2.3/lib -lz -L/app/devtools/libxml2-2.7.3/lib
-lxml2 -L/app/devtools/glib-2.14.6/lib -lglib-2.0
-L/app/devtools/refblas3-3.0-11/lib64/libblas.so.3.0.0
-L/app/devtools/liblapack3-3.2.0-5/lib64/liblapack.so.3
-L/app/devtools/fftw-3.2.1/lib -lfftw3
-L/app/devtools/gcc-4.3.3/lib64/libgfortran.so.1 -o Application.x
/app/devtools/gretl-1.8.0.org/lib/libgretl-1.0.so: undefined reference
to `dgecon_'
/app/devtools/gretl-1.8.0.org/lib/libgretl-1.0.so: undefined reference
to `dsytri_'
/app/devtools/gretl-1.8.0.org/lib/libgretl-1.0.so: undefined reference
to `dgetrs_'
/app/devtools/gretl-1.8.0.org/lib/libgretl-1.0.so: undefined reference
to `dorgqr_'
/app/devtools/gretl-1.8.0.org/lib/libgretl-1.0.so: undefined reference
to `dpocon_'
/app/devtools/gretl-1.8.0.org/lib/libgretl-1.0.so: undefined reference
to `dtrcon_'
/app/devtools/gretl-1.8.0.org/lib/libgretl-1.0.so: undefined reference
to `dgeqrf_'
/app/devtools/gretl-1.8.0.org/lib/libgretl-1.0.so: undefined reference
to `dgesvd_'
/app/devtools/gretl-1.8.0.org/lib/libgretl-1.0.so: undefined reference
to `dtrtri_'
/app/devtools/gretl-1.8.0.org/lib/libgretl-1.0.so: undefined reference
to `dsyev_'
/app/devtools/gretl-1.8.0.org/lib/libgretl-1.0.so: undefined reference
to `dsycon_'
/app/devtools/gretl-1.8.0.org/lib/libgretl-1.0.so: undefined reference
to `dgels_'
/app/devtools/gretl-1.8.0.org/lib/libgretl-1.0.so: undefined reference
to `dgelss_'
/app/devtools/gretl-1.8.0.org/lib/libgretl-1.0.so: undefined reference
to `dpptrf_'
/app/devtools/gretl-1.8.0.org/lib/libgretl-1.0.so: undefined reference
to `dgemm_'
/app/devtools/gretl-1.8.0.org/lib/libgretl-1.0.so: undefined reference
to `dgetri_'
/app/devtools/gretl-1.8.0.org/lib/libgretl-1.0.so: undefined reference
to `dpotrf_'
/app/devtools/gretl-1.8.0.org/lib/libgretl-1.0.so: undefined reference
to `dspsv_'
/app/devtools/gretl-1.8.0.org/lib/libgretl-1.0.so: undefined reference
to `dsyrk_'
/app/devtools/gretl-1.8.0.org/lib/libgretl-1.0.so: undefined reference
to `dgetrf_'
/app/devtools/gretl-1.8.0.org/lib/libgretl-1.0.so: undefined reference
to `dpotrs_'
/app/devtools/gretl-1.8.0.org/lib/libgretl-1.0.so: undefined reference
to `dpotri_'
/app/devtools/gretl-1.8.0.org/lib/libgretl-1.0.so: undefined reference
to `dpptri_'
/app/devtools/gretl-1.8.0.org/lib/libgretl-1.0.so: undefined reference
to `dsytrf_'
/app/devtools/gretl-1.8.0.org/lib/libgretl-1.0.so: undefined reference
to `dgeev_'
collect2: ld returned 1 exit status
make[1]: *** [Application.x] Error 1
make[1]: Leaving directory
`/app/home/sganguly/dev/atlas-HEAD-64/atlas/src/Application'
make: *** [All] Error 2


Note that the actual gretl shared lib was built succesfully. I get these
errors in my app from which I am trying to use the gretl lib.

Any insights/pointers anyone? 

PS: I have a suggestion as well - I think its best to avoid using C++
keywords such as "new" and "template" inside the C code for gretl as
this also causes trouble to folks that are trying to use the shared lib
from C++.

Thanks in advance,

Sunandan Ganguly

=============================================================================== 
 Please access the attached hyperlink for an important electronic communications disclaimer: 
 http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
 =============================================================================== 
 


More information about the Gretl-users mailing list