无法从非libtool对象构建libtool库 - 是否有解决方法?
我有这个用于Makefile Automake的代码:
noinst_LTLIBRARIES = libwinsane.la
libwinsane_la_SOURCES = init.c
libwinsane_la_CXXFLAGS = -I$(top_srcdir)
libwinsane_la_DEPENDENCIES = manifest.$(OBJEXT)
libwinsane_la_LIBADD = manifest.$(OBJEXT)
manifest.$(OBJEXT): manifest.rc utf8.xml
windres -o $@ $(top_builddir)/libwinsane/manifest.rc
它配置了./configure可以,但最终,“ make”命令结果错误:
libtool: error: cannot build libtool library 'libwinsane.la' from non-libtool objects on this host: manifest.o
但是我相信castest.o可以与init.o完全合并,我不明白,为什么Libtool如此努力地抱怨。有解决方案吗?
I have this code for makefile automake:
noinst_LTLIBRARIES = libwinsane.la
libwinsane_la_SOURCES = init.c
libwinsane_la_CXXFLAGS = -I$(top_srcdir)
libwinsane_la_DEPENDENCIES = manifest.$(OBJEXT)
libwinsane_la_LIBADD = manifest.$(OBJEXT)
manifest.$(OBJEXT): manifest.rc utf8.xml
windres -o $@ $(top_builddir)/libwinsane/manifest.rc
it configures with ./configure fine, but in the end, 'make' command results with error:
libtool: error: cannot build libtool library 'libwinsane.la' from non-libtool objects on this host: manifest.o
But I belive that manifest.o can be totally merged with init.o, I don't understand, why libtool complains about that so hard. Is there any solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于涉及libtool,因此将使用.lo后缀来保持一致性。这应该有助于检测源文件的双重使用(*)。
使用它的相应的主要makefile片段,我希望这样做:
如果Automake将来获得了.rc源的默认规则,这似乎是一种前向兼容的方法,因为Automake只会再次将Subtest.lo添加到Libadd,又将其添加到Libadd,这是势力。
对于默认RC,您可以添加到configure.ac:
Since libtool is involved, one would use the .lo suffix for consistency. That should help detect double use(*) of a source file.
The corresponding main makefile fragment to use it, I would do like so:
If automake gained a default rule for .rc sources in the future, this seems like a forward-compatible approach, since automake would just add manifest.lo to LIBADD again, which is idempotent.
For defaulting RC, you can add into configure.ac: