H
H.S.
Hello,
This is a bit weird problem and I am not expert in C++. I am trying to
make a small program to use the Taucs library (it is a C library for
solving sparse linear system, http://www.tau.ac.il/~stoledo/taucs/, tgz
with external libs), but I keep getting this compiler error. The example
program I am trying is this:
--------------------------------------------------------------
#include <taucs.h>
#ifdef __cplusplus
extern "C" {
#endif
extern taucs_ccs_matrix * taucs_ccs_create (int m, int n, int nnz,
int flags);
extern void taucs_css_free (taucs_ccs_matrix* );
#ifdef __cplusplus
}
#endif // __cplusplus
int main(){
int C,R,k;
C=20;
R=20;
k=4;
taucs_ccs_matrix *taucAsigmaIMat;
taucAsigmaIMat = taucs_ccs_create(C, R, (k+1)*C,
TAUCS_DOUBLE|TAUCS_SYMMETRIC);
//cleanup
taucs_ccs_free(taucAsigmaIMat);
return 0;
}
-----------------------------------------------------------------
I downloaded the Taucs library in ~/tmp/taucs and compiled it. I am
using the following command to compile my example program above and I get:
$> g++ -Wall -I$HOME/tmp/taucs/build/linux -I$HOME/tmp/taucs/src
-L$HOME/tmp/taucs/lib/linux -ltaucs -L$HOME/tmp/taucs/external/lib/linux
-latlas -lcblas -lf77blas -llapack -lmetis
$HOME/tmp/taucs/external/lib/linux/blas_aux.o spmat.cc -o spmat
In file included from /usr/include/c++/4.1.3/backward/complex.h:31,
from /home/hs/tmp/taucs/src/taucs.h:132,
from spmat.cc:1:
/usr/include/c++/4.1.3/backward/backward_warning.h:32:2: warning:
#warning This file includes at least one deprecated or antiquated
header. Please consider using one of the 32 headers found in section
17.4.1.2 of the C++ standard. Examples include substituting the <X>
header for the <X.h> header for C++ includes, or <iostream> instead of
the deprecated header <iostream.h>. To disable this warning use
-Wno-deprecated.
/home/hs/tmp/taucs/src/taucs_private.h:45: error: previous declaration
of ‘taucs_ccs_matrix* taucs_ccs_create(int, int, int, int)’ with ‘C++’
linkage
spmat.cc:6: error: conflicts with new declaration with ‘C’ linkage
The lines near taucs_private.h line 45 are (output from `less -N`):
-----------------------------------------------
36 taucs_datatype taucs_dtl(div_fn)(taucs_datatype a,
taucs_datatype b);
37 taucs_datatype taucs_dtl(neg_fn)(taucs_datatype a);
38 taucs_datatype taucs_dtl(sqrt_fn)(taucs_datatype a);
39 taucs_datatype taucs_dtl(conj_fn)(taucs_datatype a);
40 double taucs_dtl(abs_fn)(taucs_datatype a);
41
42 /*** taucs_ccs_base.c ***/
43
44 taucs_ccs_matrix* taucs_dtl(ccs_create) (int m, int n,
int nnz);
45 taucs_ccs_matrix* taucs_ccs_create (int m, int n,
int nnz, int flags);
46 void taucs_dtl(ccs_free)
(taucs_ccs_matrix* matrix);
47 void taucs_ccs_free
(taucs_ccs_matrix* matrix);
48
49 /*** taucs_ccs_ops.c ***/
50
51 void taucs_dtl(ccs_split)
(taucs_ccs_matrix* A,
52
taucs_ccs_matrix** L,
53
taucs_ccs_matrix** R,
54 int p);
----------------------------------------------------
Given the above compiler output, could somebody suggest what I am doing
wrong? Or point me in the direction to get this working.
thanks,
->HS
This is a bit weird problem and I am not expert in C++. I am trying to
make a small program to use the Taucs library (it is a C library for
solving sparse linear system, http://www.tau.ac.il/~stoledo/taucs/, tgz
with external libs), but I keep getting this compiler error. The example
program I am trying is this:
--------------------------------------------------------------
#include <taucs.h>
#ifdef __cplusplus
extern "C" {
#endif
extern taucs_ccs_matrix * taucs_ccs_create (int m, int n, int nnz,
int flags);
extern void taucs_css_free (taucs_ccs_matrix* );
#ifdef __cplusplus
}
#endif // __cplusplus
int main(){
int C,R,k;
C=20;
R=20;
k=4;
taucs_ccs_matrix *taucAsigmaIMat;
taucAsigmaIMat = taucs_ccs_create(C, R, (k+1)*C,
TAUCS_DOUBLE|TAUCS_SYMMETRIC);
//cleanup
taucs_ccs_free(taucAsigmaIMat);
return 0;
}
-----------------------------------------------------------------
I downloaded the Taucs library in ~/tmp/taucs and compiled it. I am
using the following command to compile my example program above and I get:
$> g++ -Wall -I$HOME/tmp/taucs/build/linux -I$HOME/tmp/taucs/src
-L$HOME/tmp/taucs/lib/linux -ltaucs -L$HOME/tmp/taucs/external/lib/linux
-latlas -lcblas -lf77blas -llapack -lmetis
$HOME/tmp/taucs/external/lib/linux/blas_aux.o spmat.cc -o spmat
In file included from /usr/include/c++/4.1.3/backward/complex.h:31,
from /home/hs/tmp/taucs/src/taucs.h:132,
from spmat.cc:1:
/usr/include/c++/4.1.3/backward/backward_warning.h:32:2: warning:
#warning This file includes at least one deprecated or antiquated
header. Please consider using one of the 32 headers found in section
17.4.1.2 of the C++ standard. Examples include substituting the <X>
header for the <X.h> header for C++ includes, or <iostream> instead of
the deprecated header <iostream.h>. To disable this warning use
-Wno-deprecated.
/home/hs/tmp/taucs/src/taucs_private.h:45: error: previous declaration
of ‘taucs_ccs_matrix* taucs_ccs_create(int, int, int, int)’ with ‘C++’
linkage
spmat.cc:6: error: conflicts with new declaration with ‘C’ linkage
The lines near taucs_private.h line 45 are (output from `less -N`):
-----------------------------------------------
36 taucs_datatype taucs_dtl(div_fn)(taucs_datatype a,
taucs_datatype b);
37 taucs_datatype taucs_dtl(neg_fn)(taucs_datatype a);
38 taucs_datatype taucs_dtl(sqrt_fn)(taucs_datatype a);
39 taucs_datatype taucs_dtl(conj_fn)(taucs_datatype a);
40 double taucs_dtl(abs_fn)(taucs_datatype a);
41
42 /*** taucs_ccs_base.c ***/
43
44 taucs_ccs_matrix* taucs_dtl(ccs_create) (int m, int n,
int nnz);
45 taucs_ccs_matrix* taucs_ccs_create (int m, int n,
int nnz, int flags);
46 void taucs_dtl(ccs_free)
(taucs_ccs_matrix* matrix);
47 void taucs_ccs_free
(taucs_ccs_matrix* matrix);
48
49 /*** taucs_ccs_ops.c ***/
50
51 void taucs_dtl(ccs_split)
(taucs_ccs_matrix* A,
52
taucs_ccs_matrix** L,
53
taucs_ccs_matrix** R,
54 int p);
----------------------------------------------------
Given the above compiler output, could somebody suggest what I am doing
wrong? Or point me in the direction to get this working.
thanks,
->HS