[Glade-users] how to add a library

olafandjasper@hushmail.com olafandjasper@hushmail.com
Wed, 29 Oct 2003 08:18:17 -0800


Hello:
The -L flag is required if you are using dynamic libs.

TO add your lib as a static lib 
define myapp_LDADD as follows: 
   myapp_LDADD = @PACKAGE_LIBS@ \ 
   -lz ${MYLIB_PATH}/libmylib.a 
 
TO add your lib as a dynamic lib <---- My preference
define myapp_LDADD as follows: 
   myapp_LDADD = @PACKAGE_LIBS@ \ 
   -L${MYLIB_PATH} -lmylib 

Thanks,
O

On Fri, 24 Oct 2003 03:29:34 -0700 taka hashi <wwtaka@hotmail.com> wrote:
>
> sorry, my explanation was not clear. 
>
>>In looking at your question, I am not clear if you are wanting
>to add
>>a file, a function or a library.
>
>  I wanted to add a library.
>
>  I treid to add my library [mylib.a] to myapp_LDADD,
>  It's goot to write /home/mylib.a not -L/home/mylib.a.
>
>  [-L] isn't necessary?
>
>regard
>taka
>
>
>>Otherwise if you are interested in adding libraries ...
>>The FAQ on adding libraries was confusing, so this is what I did:
>>   1. edit projects/something/src/Makefile.am
>>   2. execute projects/something/autogen.sh
>>   3. make
>>My makefile.am looks like this:
>>## Process this file with automake to produce Makefile.in
>>
>>## TO integrate MYSQL library
>>## add the path to MYSQL so make can find it:
>>MYSQLPATH=/usr
>>
>>## Replace the original INCLUDES WITH THE ONE BELOW
>>##INCLUDES = \
>>##	-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
>>##	-DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
>>##	@PACKAGE_CFLAGS@
>>##
>>## TO integrate MYSQL
>>## replace the INCLUDES def with the following:
>>INCLUDES = \
>>      -DPACKAGE_DATA_DIR=\""$(datadir)"\" \
>>      -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
>\
>>      @PACKAGE_CFLAGS@ \
>>      -I$(MYSQLPATH)/include/mysql
>>
>>bin_PROGRAMS = ssarts
>>
>>ssarts_SOURCES = \
>>	main.c \
>>	support.c support.h \
>>	interface.c interface.h \
>>	ssarts_support.c ssarts_support.h \
>>	mysql_stuff.c mysql_stuff.h \
>>	callbacks.c callbacks.h
>>
>>## Replace the original def of somethin_LDADD
>>##ssarts_LDADD = @PACKAGE_LIBS@
>>##
>>## TO integrate MYSQL using static libs
>>##  define ssarts_LDADD as follows:
>>##
>>##ssarts_LDADD = @PACKAGE_LIBS@ \
>>##-lz ${MYSQLPATH}/lib/mysql/libmysqlclient.a
>>##
>>## TO integrate MYSQL using dynamic libs
>>##  define ssarts_LDADD as follows:
>>##
>>ssarts_LDADD = @PACKAGE_LIBS@ \
>>-L${MYSQLPATH}/lib/mysql -lmysqlclient
>>
>>
>>Good luck,
>>O
>>
>>Here are the changes
>>
>>On Mon, 20 Oct 2003 05:33:46 -0700 taka hashi <wwtaka@hotmail.com>
>wrote:
>> >Hi.
>> >My name is Takahashi using glade2.0.
>> >I don't know how to add a library to a project.
>> >please give me an advice.
>> >
>> >is the following method incollect?
>> >
>> > 1) edit [makefile.am]
>> >   INCLUDES = $(default)
>> >                     -I(my own library name)  <add>
>> >   project1_LDADD = $(default)
>> >                             -L(my own library name) <add>
>> >
>> > 2) do [autogen.sh].
>> >
>> > 3) add (a) function of my own library in callbacks.c.
>> >
>> >after 1)-3),
>> > when doing [make], undefined reference to (a)  showed.
>> >
>> > why undefined?
>> >
>> >
>> >
>> >$B!c(B takahashi wwtaka@hotmail.com $B!d(B
>> >
>> >_________________________________________________________________
>> >$B$"$J$?$N(BPC$B$r<i$k$?$a$KDj4|E*$J%;%-%e%j%F%#BP:v$r!#%^%$%/%m%=%U%H(B
>> >$B%;%-%e%j(B
>> >$B%F%#>pJs%;%s%?!<(B http://www.microsoft.com/japan/protect/hm.asp
>> >>
>> >>
>> >_______________________________________________
>> >Glade-users maillist  -  Glade-users@lists.ximian.com
>> >http://lists.ximian.com/mailman/listinfo/glade-users
>> >
>> >
>>
>>
>>
>>Concerned about your privacy? Follow this link to get
>>FREE encrypted email: https://www.hushmail.com/?l=2
>>
>>Free, ultra-private instant messaging with Hush Messenger
>>https://www.hushmail.com/services.php?subloc=messenger&l=434
>>
>>Promote security and make money with the Hushmail Affiliate Program:
>>https://www.hushmail.com/about.php?subloc=affiliate&l=427
>
>_________________________________________________________________
>$B$"$J$?$N(BPC$B$r<i$k$?$a$KDj4|E*$J%;%-%e%j%F%#BP:v$r!#%^%$%/%m%=%U%H(B
>$B%;%-%e%j(B
>$B%F%#>pJs%;%s%?!<(B http://www.microsoft.com/japan/protect/hm.asp
>>
>>
>_______________________________________________
>Glade-users maillist  -  Glade-users@lists.ximian.com
>http://lists.ximian.com/mailman/listinfo/glade-users
>
>



Concerned about your privacy? Follow this link to get
FREE encrypted email: https://www.hushmail.com/?l=2

Free, ultra-private instant messaging with Hush Messenger
https://www.hushmail.com/services.php?subloc=messenger&l=434

Promote security and make money with the Hushmail Affiliate Program: 
https://www.hushmail.com/about.php?subloc=affiliate&l=427