【发布时间】:2021-10-01 14:11:11
【问题描述】:
我见过Passing "-no-undefined" to Libtool LDFLAG;我在那里尝试了所有方法,但不幸的是我无法让它工作。
这是我的问题:我正在尝试在 Cygwin64 下构建 liblo。我所做的只是:
wget http://downloads.sourceforge.net/liblo/liblo-0.31.tar.gz
tar xzvf liblo-0.31.tar.gz
cd liblo-0.31
./configure
make
编译通过没有问题,然后链接阶段来了,我得到:
CCLD liblo.la
libtool: error: can't build x86_64-unknown-cygwin shared library unless -no-undefined is specified
make[3]: *** [Makefile:728: liblo.la] Error 1
这里是Makefile.am;我试过在那里插入:
AM_LIBTOOLFLAGS = -no-undefined
AM_LDFLAGS = -no-undefined
...然后运行:
automake
./configure
make
...但这无济于事,我得到了同样的错误。
请注意,这里可能会有额外的混淆:根据stunnel build chokes on -no-undefined - Cygwin-apps mailing list:
有 GNU ld 标志 --no-undefined(两个破折号),还有 libtool 标志 -no-undefined(一个破折号)。它们不一样,并且拼写出来 -no-undefined 不会使 libtool 向链接器提供 --no-undefined 。 libtool 也不查找 -Wl,--no-undefined。 -Wl,-no-undefined 似乎是 一些混乱的混合体。
那么,我如何/在哪里添加这个-no-undefined 开关到这个项目中?
【问题讨论】:
-
通常在 Makefile.am 中添加
liblo_la_LDFLAGS = -no-undefined