Re: compiling taucs problem (Re: solving Ax=b with sparse A)



H.S. wrote:

Okay, that makes sense. I also got similar advice from comp.lang.c++.
(the people there are fanatically picky about talking about *only* about
C++ language ... so I don't think I get further insights from there).

Strictly speaking this is not ontopic here either.

I tried it again without the extern keyword. Here is my example program
I am trying now:
-----------------------------------------------------------
#define TAUCS_CORE_DOUBLE

#include <taucs.h>

extern taucs_ccs_matrix* taucs_ccs_create(int m,int n,int nnz,int flags);
extern void taucs_ccs_free(taucs_ccs_matrix* matrix);

As I wrote, these two declarations are wrong, because they are already in
one of the taucs header files. You declare here two functions with C++
linkage, but taucs is written in C, and the library contains these function
with C linkage. That is the reason for your linker error.

I recall that I compiled the taucs library using CC=gcc during the make
step. I can't see what I am doing wrong while compiling the example
program above, do you think there could be a problem in compiling the
taucs library to begin with?

Your problem is that taucs is written in C, and because it uses C99 complex
numbers (at least in the default configuration) it cannot be used directly
from C++ (the C++ standard does not include the C99 complex keywords).
If you can configure it to not use C99 complex types, then it might work if
you specify C linkage for the taucs stuff:

extern "C" {
#include <taucs.h>
}

Otherwise, you'll need to create a wrapper. Evgenii Rudnyi told not long ago
that he has written one: Message-ID:
<1185006162.197752.74000@xxxxxxxxxxxxxxxxxxxxxxxxxxx>


Georg
.



Relevant Pages