gpt4 book ai didi

makefile - 我的库因 libtool 错误而无法构建

转载 作者:行者123 更新时间:2023-12-02 17:47:53 25 4
gpt4 key购买 nike

我正在尝试让我的 HTML Tidy c++ 包装器库在 Linux 上构建(目前正在 Ubuntu 上测试),但是 make 失败并出现 libtool 错误:“libtool:链接:您必须指定一个输出文件”

这是我的 Makefile.am:

## tidypp:
## A c++ wrapper around HTML Tidy Lib

AUTOMAKE_OPTIONS = subdir-objects
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4

lib_LTLIBRARIES = libtidypp-@TIDYPP_API_VERSION@.la

libtidypp_@TIDYPP_API_VERSION@_la_CPPFLAGS = $(DEPS_CFLAGS)
libtidypp_@TIDYPP_API_VERSION@_la_LIBADD = -ltidy $(DEPS_LIBS)

libtidypp_@TIDYPP_API_VERSION@_la_SOURCES = src/attribute.cpp src/buffer.cpp \
src/document.cpp src/inputsource.cpp src/mem.cpp src/node.cpp src/option.cpp \
src/outputsink.cpp src/tidypp.cpp include/tidypp/attribute.hpp \
include/tidypp/basic_wrapper.hpp include/tidypp/buffer.hpp \
include/tidypp/document.hpp include/tidypp/inputsource.hpp \
include/tidypp/io.hpp include/tidypp/mem.hpp include/tidypp/node.hpp \
include/tidypp/option.hpp include/tidypp/outputsink.hpp include/tidypp/tidypp.hpp

libtidypp_@TIDYPP_API_VERSION@_la_LDFLAGS = -version-info $(tidypp_SO_VERSION)

tidypp_includedir=$(includedir)/tidypp-@TIDYPP_API_VERSION@/tidypp
tidypp_include_HEADERS = include/tidypp/attribute.hpp \
include/tidypp/basic_wrapper.hpp include/tidypp/buffer.hpp \
include/tidypp/document.hpp include/tidypp/inputsource.hpp \
include/tidypp/io.hpp include/tidypp/mem.hpp include/tidypp/node.hpp \
include/tidypp/option.hpp include/tidypp/outputsink.hpp include/tidypp/tidypp.hpp

tidypp_libincludedir = $(libdir)/tidypp-$(TIDYPP_API_VERSION)/include
nodist_tidypp_libinclude_HEADERS = tidyppconfig.h

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = tidypp-$(TIDYPP_API_VERSION).pc

dist_noinst_SCRIPTS = autogen.sh

和我的configure.ac:

## libtidypp:
## a c++ wrapper around html tidy lib

AC_INIT([libtidypp], [1.0], [francesco1149@gmail.com], [tidypp],
[http://code.google.com/p/tidypp/])
AC_PREREQ([2.59])
AM_INIT_AUTOMAKE([1.10 -Wall no-define])

AC_CONFIG_MACRO_DIR([m4])

AC_CONFIG_HEADERS([config.h tidyppconfig.h])
AC_PROG_CXX
LT_INIT([disable-static])

AC_SUBST([TIDYPP_SO_VERSION], [0:0:0])
AC_SUBST([TIDYPP_API_VERSION], [1.0])

AC_CONFIG_FILES([Makefile
tidypp-${TIDYPP_API_VERSION}.pc:tidypp.pc.in])
AC_OUTPUT

这是 make 的输出:

make  all-am

make[1]: Entering directory `/home/francesco/tidypp'

depbase=`echo src/attribute.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -g -O2 -MT src/attribute.lo -MD -MP -MF $depbase.Tpo -c -o src/attribute.lo src/attribute.cpp &&\
mv -f $depbase.Tpo $depbase.Plo

libtool: compile: g++ -DHAVE_CONFIG_H -I. -g -O2 -MT src/attribute.lo -MD -MP -MF src/.deps/attribute.Tpo -c src/attribute.cpp -fPIC -DPIC -o src/.libs/attribute.o

depbase=`echo src/buffer.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -g -O2 -MT src/buffer.lo -MD -MP -MF $depbase.Tpo -c -o src/buffer.lo src/buffer.cpp &&\
mv -f $depbase.Tpo $depbase.Plo

libtool: compile: g++ -DHAVE_CONFIG_H -I. -g -O2 -MT src/buffer.lo -MD -MP -MF src/.deps/buffer.Tpo -c src/buffer.cpp -fPIC -DPIC -o src/.libs/buffer.o

depbase=`echo src/document.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -g -O2 -MT src/document.lo -MD -MP -MF $depbase.Tpo -c -o src/document.lo src/document.cpp &&\
mv -f $depbase.Tpo $depbase.Plo

libtool: compile: g++ -DHAVE_CONFIG_H -I. -g -O2 -MT src/document.lo -MD -MP -MF src/.deps/document.Tpo -c src/document.cpp -fPIC -DPIC -o src/.libs/document.o

depbase=`echo src/inputsource.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -g -O2 -MT src/inputsource.lo -MD -MP -MF $depbase.Tpo -c -o src/inputsource.lo src/inputsource.cpp &&\
mv -f $depbase.Tpo $depbase.Plo

libtool: compile: g++ -DHAVE_CONFIG_H -I. -g -O2 -MT src/inputsource.lo -MD -MP -MF src/.deps/inputsource.Tpo -c src/inputsource.cpp -fPIC -DPIC -o src/.libs/inputsource.o

depbase=`echo src/mem.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -g -O2 -MT src/mem.lo -MD -MP -MF $depbase.Tpo -c -o src/mem.lo src/mem.cpp &&\
mv -f $depbase.Tpo $depbase.Plo

libtool: compile: g++ -DHAVE_CONFIG_H -I. -g -O2 -MT src/mem.lo -MD -MP -MF src/.deps/mem.Tpo -c src/mem.cpp -fPIC -DPIC -o src/.libs/mem.o

depbase=`echo src/node.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -g -O2 -MT src/node.lo -MD -MP -MF $depbase.Tpo -c -o src/node.lo src/node.cpp &&\
mv -f $depbase.Tpo $depbase.Plo

libtool: compile: g++ -DHAVE_CONFIG_H -I. -g -O2 -MT src/node.lo -MD -MP -MF src/.deps/node.Tpo -c src/node.cpp -fPIC -DPIC -o src/.libs/node.o

depbase=`echo src/option.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -g -O2 -MT src/option.lo -MD -MP -MF $depbase.Tpo -c -o src/option.lo src/option.cpp &&\
mv -f $depbase.Tpo $depbase.Plo

libtool: compile: g++ -DHAVE_CONFIG_H -I. -g -O2 -MT src/option.lo -MD -MP -MF src/.deps/option.Tpo -c src/option.cpp -fPIC -DPIC -o src/.libs/option.o

depbase=`echo src/outputsink.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -g -O2 -MT src/outputsink.lo -MD -MP -MF $depbase.Tpo -c -o src/outputsink.lo src/outputsink.cpp &&\
mv -f $depbase.Tpo $depbase.Plo

libtool: compile: g++ -DHAVE_CONFIG_H -I. -g -O2 -MT src/outputsink.lo -MD -MP -MF src/.deps/outputsink.Tpo -c src/outputsink.cpp -fPIC -DPIC -o src/.libs/outputsink.o

depbase=`echo src/tidypp.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -g -O2 -MT src/tidypp.lo -MD -MP -MF $depbase.Tpo -c -o src/tidypp.lo src/tidypp.cpp &&\
mv -f $depbase.Tpo $depbase.Plo

libtool: compile: g++ -DHAVE_CONFIG_H -I. -g -O2 -MT src/tidypp.lo -MD -MP -MF src/.deps/tidypp.Tpo -c src/tidypp.cpp -fPIC -DPIC -o src/.libs/tidypp.o

/bin/bash ./libtool --tag=CXX --mode=link g++ -g -O2 -version-info -o libtidypp-1.0.la -rpath /usr/local/lib src/attribute.lo src/buffer.lo src/document.lo src/inputsource.lo src/mem.lo src/node.lo src/option.lo src/outputsink.lo src/tidypp.lo

libtool: link: you must specify an output file
libtool: link: Try `libtool --help --mode=link' for more information.
make[1]: *** [libtidypp-1.0.la] Error 1
make[1]: Leaving directory `/home/francesco/tidypp'
make: *** [all] Error 2

完整项目和源代码在这里:http://code.google.com/p/tidypp/

最佳答案

您没有将参数传递给 -version-info,因此 libtool-o 解释为所需的参数选项。看来错误在行中

libtidypp_@TIDYPP_API_VERSION@_la_LDFLAGS = -version-info $(tidypp_SO_VERSION)

应该改为 $(TIDYPP_SO_VERSION)make 中的变量名称区分大小写。

关于makefile - 我的库因 libtool 错误而无法构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12338948/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com