[gst-devel] Compiling Plugin with additional Libraries

Sameer Naik sameer at nextbitcpu.com
Fri Feb 3 02:48:01 CET 2006


Hi
    ok i tried quite some stuff from what u suggested...heres it
since the libs im using aren't having the lib prefix, meaning they are
not like libalgorithm.a instead they are algorithm.a, so i guess i cant
use -lalgorithm, 
since i read on some webpage that -lalgorithm would mean that the linker
would look for libalgorithm.a... so heres what i did to include the libs

/*command seq 01*/
./configure --prefix=/opt/gstreamer CFLAGS=-I/opt/include
LDFLAGS="-L/opt/lib/algorithm.a  -L/opt/lib/memory.a
-L/opt/lib/math.lib"
make
make install

i figured that ldd on the plugins.so file won't show me any of the libs
i've included, since my libs are static libs
so heres a small check i carried out
first i compiled the plugin without including any of my libs with the
following commands

/*command seq 02*/
./configure --prefix=/opt/gstreamer CFLAGS=-I/opt/include
make
make install

then i checked the properties of the libraries (only size of interest
here)...heres the output
-rw-r--r--    1 root root 16816 Feb  3 01:36 libgstgdec.a
-rwxr-xr-x  1 root root  1148 Feb  3 01:36 libgstgdec.la
-rwxr-xr-x  1 root root 39723 Feb  3 01:36 libgstgdec.so

and then i compiled again including the libraries using command sequence
01 (above)... heres the output
-rw-r--r--    1 root root 16816 Feb  3 15:16 libgstgdec.a
-rwxr-xr-x  1 root root  1483 Feb  3 15:16 libgstgdec.la
-rwxr-xr-x  1 root root 39723 Feb  3 15:16 libgstgdec.so

so looking carefully at the sizes. they change for libgstgdec.la ... a
diiference in size of 335...
next i checked the total size of the libs im including (ie. the .a
and .lib files), which comes out to be 336.8 Kb...
does this mean that my libs are getting included?? i mean is it that
including static libs (.a, .lib files) would affect the size of
libgstgdec.la file.

also does changing the lib name from algorithm.a to libalgorithm.a have
any side affect on the library? (hope u get what i mean.)
-----thats it for the compile

next.. on the research i did.. i found that .a means nothing but an
archive of .o files...so i could extract the .o files from the archive
so are there any options that i could give the ./configure script or the
makefile to include these .o files while linking...

u must have noticed by now, that these libs are not created/compiled by
me. ;).
anyways plz help me some more :) .

awaiting ur replies.
bye
take care
sameer

On Thu, 2006-02-02 at 13:53 +0100, Stefan Kost wrote: 

> Hi Sameer,
> 
> so the libs are your own. In this case forget the pkg-config stuff for now (that 
> is used for third party stuff).
> 
> All you need is to add something lib '-lalgorithm -lmemory' to your LDFLAGS.
> 
> Stefan
> 
> Sameer Naik wrote:
> > thanks man...
> > i really appreciate the help
> > but, i really need some guidance here... i dont wanna screw stuff up.
> > 
> > let me explain my scenario...
> > my libraries are in
> > /opt/lib/
> > the files inside this folder are like
> > algorithm.a
> > memory.a
> > math.lib
> > and so on
> > 
> > the includes are in
> > /opt/include
> > (no problem with these getting included,...since i dont get compilation 
> > errors)
> > 
> > dunno much about pkg-config...so u gotta help me here too
> > my pkg-config path is PKG_CONFIG_PATH=/opt/gstreamer/lib/pkgconfig
> > 
> > so plz lemme know how to locate the lib using pkg-config
> > and also about LDADD, LDFLAGS (actually i know a bit about this....just 
> > wanna make sure)
> > 
> > plz help
> > awaiting ur reply
> > thanks
> > take care
> > Sameer
> > 
> > 
> > On Wed, 2006-02-01 at 21:37 +0100, Stefan Kost wrote:
> > 
> >>hi,
> >>
> >>if ldd does not show the lib, its not linked against it. You should
> >>locate the lib using pkg-config or the like and add the lib to the
> >>variables in Makefile.am (LDADD, LDFLAGS, ..).
> >>If ldd shows the lib, but can't resolv it, check that /opt/lib is in you
> >>ld.so.conf.
> >>
> >>Stefan
> >>
> >>Sameer Naik wrote:
> >>> Hello everyone...
> >>> i have developed a plugin that need additional libraries to get working
> >>>
> >>> the include file for my library are  in
> >>> */opt/include*
> >>>
> >>> and the library files are in
> >>> */opt/lib*
> >>>
> >>> i have developed my plugin using the plugin template available in the
> >>> gstreamer cvs.
> >>>
> >>> heres what i do to compile my plugin
> >>> ./configure CFLAGS=-I/opt/include LDFLAGS=-L/opt/lib
> >>> make
> >>> make install
> >>>
> >>> (i do nothing more than this to tell the compiler about the libraries
> >>> i wanna use.)
> >>>
> >>> my plugin gets compiled well
> >>> when i do a gst-inspect on my plugin it says "plugin or element not found"
> >>>
> >>> i did an ldd on the .so file of my plugin to check what libraries its
> >>> compiled against, and none of
> >>> my libraries (the libs i wanna use) are shown, only the gstreamer,
> >>> glibc,and so on are shown...
> >>>
> >>> im quite sure that the external libraries i want to use are not
> >>> getting linked to my plugin...probably im missing something..
> >>> looks like im missing something really minor, something im not aware
> >>> of :)...
> >>>
> >>> plz help
> >>> thanks in advance
> >>> take care
> >>> Sameer 
> >>
> >>
> >>
> >>-------------------------------------------------------
> >>This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> >>for problems?  Stop!  Download the new AJAX search engine that makes
> >>searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> >>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642>
> >>_______________________________________________
> >>gstreamer-devel mailing list
> >>gstreamer-devel at lists.sourceforge.net <mailto:gstreamer-devel at lists.sourceforge.net>
> >>https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
> >>
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20060203/1ae38e45/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smiley-3.png
Type: image/png
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20060203/1ae38e45/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smiley-4.png
Type: image/png
Size: 822 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20060203/1ae38e45/attachment-0001.png>


More information about the gstreamer-devel mailing list