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



H.S. wrote:

And the following is the compiler output I get:
$> g++ -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


So, what am I doing wrong here?

The compiler tells it: The function declaration in line 6 of spmat.cc
conflicts with the declaration in taucs_private.h, line 45. It should work
if you remove your own declaration in spmat.cc.
In general it should not be needed to declare anything from a library, the
library author should have done that in the header files already. If this
is not the case then I'd question the quality of the library (the only
exception are fortran libraries that you call from C, then you usually need
to build your own declarations).


Georg
.



Relevant Pages

  • Re: to learn jQuery if already using prototype
    ... the navigator.userAgent string is a reflection of the HTTP User Agent ... header then any such direction must lead to the definition of the header ... browsers using the UA string whenever two different browsers use UA ... things that gets proposed as a justification for libraries of this sort ...
    (comp.lang.javascript)
  • Re: About libraries and headers
    ... You are assuming that the contents of a header file are closely ... The standard header files ... which are used to build the libraries. ... compiling them would not generate any ...
    (comp.lang.c)
  • Re: regarding external function(Ss)
    ... than having a "#include" for the header file that declares it. ... extern void *malloc; ... effectively copies the contents of that header into your source file. ... declaration is from an included header or from the source file itself. ...
    (comp.lang.c)
  • Re: bool & stdbool.h
    ... libraries. ... "library", it is a header. ... Dinkumware http://dinkumware.com/manuals/reader.aspx?lib=cpp which lists the ... Standard C library. ...
    (comp.lang.c.moderated)
  • Re: Quantized Indexing Source Code (update & alg. history)
    ... This however is not (unless the header is used in only one place). ... the same variable in multiple translation units ... if you have conflicting definitions it just arbitrarily and without ...
    (comp.compression)