[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linking to external static (!) library

From: Martin Helm
Subject: Re: Linking to external static (!) library
Date: Tue, 19 Apr 2011 20:03:25 +0200
User-agent: KMail/1.13.6 (Linux/; KDE/4.6.0; x86_64; ; )

Am Dienstag, 19. April 2011, 19:23:53 schrieb TOT:
> Hi everyone.
> There is a big static C library (several lib*.a files). It contains
> references to MPI library (I'm not sure how)
> There is one header file (c*.h), containing several other header files and
> so on.
> This library compiled using gcc (compatible with octave).
> Lets assume that in the library "myopen" function exists. I want to call it
> in the octave and return the value of it (say 1 if everything is OK and -1
> on error).
> I'm tying to use OCT files, but I end up with an error from ld: "recompile
> with -fPIC".
> The library is huge, makefiles are huge and -fPIC option to be placed in
> too many places, so I don't want to do this.
> Two questions:
> Is there any way to link to this library (via tweaking mkoctfile or by
> other means, but not recompiling the library)?
> Is it the same for matlab?
> Regards,
> Anar.
I can be wrong since I never tried it (what you want to try), but I doubt it 
is possible since the man page of mkoctfile explicitely states
"mkoctfile is used to compile C, C++, or Fortran source code in to a 
dynamically loadable .oct file for octave"
You will have no luck creating a dynamically loadable file when linking against 
a library built without -fPIC.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]