igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] [slightly OT] statically linked executable


From: Tamas Nepusz
Subject: Re: [igraph] [slightly OT] statically linked executable
Date: Mon, 16 May 2011 14:21:57 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10

> Now I am getting errors mentioning undefined references to math functions:
You'll also need -lm and -lxml2 somewhere in the command line. Maybe also
-lz because -lxml2 depends on that.

> Now I am very puzzled. I guess I need to provide -L of all the libraries 
> igraph has been compiled with?
Well, that's always the same when you are compiling statically. Basically,
libigraph.a includes all the compiled code from igraph but not from its
dependencies, so, for instance, it does not contain the XML parsing code, or
the math routines. When you are linking dynamically, all these dependencies
are resolved at run-time as the dynamic linker pulls these dependencies in
along with libigraph.so. When you are compiling statically, you have to
specify all these dependencies manually.

Actually, if you have pkg-config, "pkg-config --static --libs igraph" should
give you all the switches you need for the static linking stage (apart from
-static itself). Similarly, "pkg-config --cflags igraph" should give you the
switches for the include dirs.

-- 
T.



reply via email to

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