Linking static and shared libraries in the KDevelop Environment

matthew studley Matthew2.Studley at uwe.ac.uk
Wed Oct 19 15:47:19 BST 2005


Hi Tris

Try adding the libraries without path using automake manager using the
form -l(libname) eg. to link libfoo.a  use -lfoo

Then specify path(s) using LDFLAGS e.g. 

-L/path/to/first/lib -L/path/to/next/lib etc

Specify paths to header files in CPPFLAGS

This sorted me out recently when I needed to install on remote machine
with different locations of libraries.  Just export new string for
LDFLAGS and away you go.

hope this helps

Matt 

p.s. there's an item in the faq about this.

http://www.kdevelop.org/mediawiki/index.php/FAQ#How_to_link_against_a_.so_library.3F

p.p.s. Compared with the task of integrating third party code in
multiple locations using autotools by hand... KDevelop rocks!

On Wed, 2005-10-19 at 16:01 +0200, Tristan Robert Martindale wrote:
> Right here goes...
> 
> I am using the KDevelop environment to write simulation software on
> SuSE 9.2 Pro. I am using third party libraries for the mathematics and
> would lke to do so for the plotting.
> The math library is static(.a). The only way I can get it to link is
> by placing its full path in "Project -> Project options -> Configure
> Options -> Linker flags (LDFLAGS):". I then include the header files
> by using the Automake Manager and right clicking "src" selecting the
> "Includes" tab and adding the relevant directory to the "Directories
> outside project" pane. This works fine.
> 
> I also tried another method of linking the static library: in the
> Automake manager I right click on the program and select "Options". I
> then select the Libraries tab and add the full path of the library to
> the "Link libraries outside project (LDADD)" window. When I try and
> compile with this method the error messages stating "undefined
> reference to ..." disappear and instead I get "Exited with status: 2".
> 
> The exact same thing happens when I try to link a shared library in
> this fashion. However I cannot seem to add multiple libraries to the
> Linker flags box as described above. I have tried space, coma and
> semi-colon separated lists with no success. I get "Exited with status:
> 77" from autoconf.
> 
> I have no idea what to do now and am intensely frustrated. I need to
> link more than one library and just cannot seem to do it. The
> documentation for Kdevelop is very poor being significantly
> incomplete!
> 
> I would appreciate some help on this matter. Am I going about the
> linking the correct way or is there a better way to do it?
> 
> Regards
> Tristan 
> -- 
> Tristan Robert Martindale
> BSc(Eng)(Aeronautical)
> TMI Consultancy
> Office M47, The Innovation Center
> The Innovation Hub, Persequor X10
> Pretoria, 0000, South Africa
> email: trmartindale at tmiconsult.co.za
> Work Phone: +27 (012) 844 0311
> Home Phone: +27 (011) 356 0602
> Cellular Phone: +27 083 264 5142 
> 
> ______________________________________________________________________
> This incoming email to UWE has been independently scanned for viruses
> and any virus detected has been removed using McAfee anti-virus
> software
> 
> 
> - to unsubscribe from this list send an email to
> kdevelop-request at kdevelop.org with the following body: unsubscribe
> »your-email-address«




This email has been independently scanned for viruses and any virus software has been removed using McAfee anti-virus software

-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list