丢脸,原来配置在 src/Makefile.am 里面,已经有了 xx_LDADD = @XX_LIBS@
不想弄得太松散,就在configure.ac里面加了个AC_CHECK_LIB,其实是不太想用这
个,还得指定一个函数。。。
现在搞定了,结贴~~
于 2011年02月22日 14:07, zyichi(a)gmail.com 写道:
include $(top_srcdir)/config/Makefile.am
CXX = g++
# bin_PROGRAMS = dbproxy dbproxy_unittests
bin_PROGRAMS = dbproxy
dbproxy_SOURCES = \
dbproxy.cc server.cc \
config.cc config.h \
packet_buffer.cc packet_buffer.h \
client.h client.cc acceptor.cc acceptor.h
dbproxy_CXXFLAGS = $(COMMON_CFLAGS) \
`pkg-config --cflags libdbp` \
`mysql_config --cflags`
dbproxy_LDFLAGS = $(COMMON_LIBS) \
-L$(top_srcdir)/base -lbase \
-L$(top_srcdir)/mysqld -lmysqld \
-L$(top_srcdir)/proto -lproto \
-L$(top_srcdir)/db -ldb \
`pkg-config --libs libdbp` \
`mysql_config --libs`
dbproxy_unittests_SOURCES = \
dbproxy_unittests.cc packet_buffer.cc \
packet_buffer_unittest.cc
dbproxy_unittests_CXXFLAGS = \
`mysql_config --cflags` \
-I${HOME}/google-lib/include
dbproxy_unittests_LDFLAGS = \
`mysql_config --libs` \
-L${HOME}/google-lib/lib \
-L$(top_srcdir)/base -lbase \
-L$(top_srcdir)/proto -lproto \
-lpthread \
-lgtest
2011/2/22 Mike<zhtx10(a)gmail.com>
> Google了下,貌似要 [程序名]_LDADD = -lpthread -lgdbm
> 我就写了
> test_LDADD = -lpthread -lgdbm
> 出现错误信息说test未定义。。。
> 我又写了
> bin_PROGRAMS = test
> 还是有问题。。。
>
> 于 2011年02月21日 22:59, Robin Lee 写道:
>> 在 Makefile.am 中加入
>> LDADD = -lpthread -lgdbm
>>
>> 这还是很基础的吧
>>
>> 2011/2/21 Mike<zhtx10(a)gmail.com>
>>
>>> 明知道有可能不会获得回复,我愿意一试。
>>> 我的一个用automake/autoconf管理的程序使用了pthread和gdbm,只需要在编译器
>>> 和链接器中加入 -lpthread -lgdbm,可是我只是刚学automake/autoconf,不知道
>>> 怎么弄,跪求帮助!
>>>
>>> --
>>> Mike.
>>> Blog:
http://ekd123.is-programmer.com/
>>> Fedora Project Contributor.
>>>
>>> _______________________________________________
>>> Chinese mailing list
>>> Chinese at
lists.fedoraproject.org
>>>
https://admin.fedoraproject.org/mailman/listinfo/chinese
>>>
>> _______________________________________________
>> Chinese mailing list
>> Chinese at
lists.fedoraproject.org
>>
https://admin.fedoraproject.org/mailman/listinfo/chinese
> --
> Mike.
> Blog:
http://ekd123.is-programmer.com/
> Fedora Project Contributor.
>
> _______________________________________________
> Chinese mailing list
> Chinese at
lists.fedoraproject.org
>
https://admin.fedoraproject.org/mailman/listinfo/chinese
>
_______________________________________________
Chinese mailing list
Chinese at
lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/chinese