[FZH] AUTOMAKE -l链接器参数

zyichi在gmail.com zyichi在gmail.com
星期二 二月 22 06:07:45 UTC 2011


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在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在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 的更多信息