[Dune] Problems with linking an external library

Andreas Dedner a.s.dedner at warwick.ac.uk
Tue Sep 16 11:29:37 CEST 2014


Hi.
Take a look at the umfpack header. It includes the lines
#ifdef __cplusplus
extern "C" {
#endif
Which is the correct way to get around the problem.
Best
Andreas

On 16/09/14 10:23, Sacconi, Andrea wrote:
> Hi Christian,
>
> yeah, workaround is not the correct terminology, I agree.
> The thing that puzzled me was that UMFPACKl, which is written in C, never gave me any problem of handling legacy C-headers.
> That's why I was perplexed when I couldn't make this library be linked correctly.
>
> Best,
> Andrea
> __________________________________________________________
>
> Andrea Sacconi
> PhD student, Applied Mathematics
> AMMP Section, Department of Mathematics, Imperial College London,
> London SW7 2AZ, UK
> a.sacconi11 at imperial.ac.uk
>
> ________________________________________
> From: Christian Engwer [christian.engwer at uni-muenster.de]
> Sent: 16 September 2014 10:21
> To: Sacconi, Andrea
> Cc: Bernd Flemisch; dune at dune-project.org
> Subject: Re: [Dune] Problems with linking an external library
>
> Dear Andrea,
>
>> extern "C"{
>> #include "ldl.h"
>> }
> this is not a work-around, but the correct way to handle legacy
> C-headers.
>
> C++ allows many functions with the name name, but different
> parameters, thus the C++ compiler automatically created new names,
> wwhich include the parameters, i.e. mangled names. YOur problem was
> that the lib included the plain C-names, but the program references
> the mangled name.
>
> Ciao
> Christian
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune





More information about the Dune mailing list