使用自动工具编译共享库/插件时出现问题

发布于 2024-11-24 19:04:43 字数 676 浏览 4 评论 0原文

我对 autotools 很陌生,看起来我对 libtool 有问题 - 它没有构建共享库,而是创建了一个静态库......

这就是我的 configure.ac 的样子:

AC_PREREQ([2.67])
AC_INIT([helloworld], [1.0], [...])
AM_INIT_AUTOMAKE([foreign])
LT_INIT

# Checks for programs.
AC_PROG_CXX
AC_PROG_LIBTOOL

# Checks for header files.
AC_CHECK_HEADERS([alloca.h inttypes.h stdint.h])

AC_CONFIG_FILES([Makefile])
AC_OUTPUT

和 Makefile.am:

noinst_LTLIBRARIES=helloworld.la

helloworld_la_CXXFLAGS=-w -DLINUX ...
helloworld_la_LDFLAGS=-avoid-version -module -shared -export-dynamic

# List of source files
helloworld_la_SOURCES=helloworld.cpp ...

这里有什么问题吗?

感谢您的任何帮助。

I'm very new to autotools and it looks like I have a problem with libtool - it doesn't build a shared library and makes a static one instead...

This is how my configure.ac looks like:

AC_PREREQ([2.67])
AC_INIT([helloworld], [1.0], [...])
AM_INIT_AUTOMAKE([foreign])
LT_INIT

# Checks for programs.
AC_PROG_CXX
AC_PROG_LIBTOOL

# Checks for header files.
AC_CHECK_HEADERS([alloca.h inttypes.h stdint.h])

AC_CONFIG_FILES([Makefile])
AC_OUTPUT

and Makefile.am:

noinst_LTLIBRARIES=helloworld.la

helloworld_la_CXXFLAGS=-w -DLINUX ...
helloworld_la_LDFLAGS=-avoid-version -module -shared -export-dynamic

# List of source files
helloworld_la_SOURCES=helloworld.cpp ...

Is there something wrong here?

Thanks for any help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

胡渣熟男 2024-12-01 19:04:43

我相信你想要

lib_LTLIBRARIES = helloworld.la

使用 noinst 指示 libtool 构建一个便利的库,而那些
通常不共享。

I believe you want

lib_LTLIBRARIES = helloworld.la

Using noinst instructs libtool to build a convenience library, and those
are not typically shared.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文