Programing

libtool 버전 ​​불일치 오류

crosscheck 2020. 11. 1. 17:21
반응형

libtool 버전 ​​불일치 오류


Ubuntu 10.04에서 kdevelop 3.5로 애플리케이션을 빌드 할 때 다음 오류가 발생합니다.

libtool: Version mismatch error. This is libtool 2.2.6 Debian-2.2.6a-4, but the
libtool: definition of this LT_INIT comes from libtool 2.2.6b.
libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 Debian-2.2.6a-4
libtool: and run autoconf again.
make[2]: *** [wktools4] Error 63
make[2]: Target `all' not remade because of errors.
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
*** Exited with status: 2 ***

필요한 libtool 버전을 어디서 구할 수 있습니까? 또는 aclocal.m4를 다시 만들 수있는 방법은 무엇입니까?


실행 해보세요

autoreconf --force --install
./configure
make

프로젝트의 루트 디렉토리에 있습니다.

그래도 작동하지 않으면 make maintainer-clean먼저 실행 한 다음 1 단계로 이동하십시오.

그래도 작동하지 않으면을 실행 make maintainer-clean한 다음 프로젝트의 루트 디렉터리에서 생성 된 모든 파일을 삭제합니다. 를 포함하여 aclocal.m4어떤, m4디렉토리, 어떤 autom4te.cache디렉토리, configure, Makefile.in, config.h, config.h.in, config.status, libtool, ltmain.sh, 등 그런 다음 1 단계로 이동합니다.

이것이 작동하는 이유 : libtool 그리고 aclocal.m4두 파일 모두 빌드 시스템에서 생성됩니다. 동기화되지 않은 경우 (다른 버전의 빌드 도구에서 생성됨)이 오류가 발생합니다. 일반적으로 그렇게해서는 안되지만, 생성 된 파일을 소스 제어에 체크인 할 때 발생할 수있는 일의 예입니다.

이 솔루션이하는 일은 자동 생성 된 모든 파일을 삭제하고 다시 생성하는 것입니다. 지우고 재생성하면 더 이상 동기화되지 않습니다.


시험

autoreconf -i

-i옵션은 중요합니다.


Anaconda를 사용하는 경우 다른 소스의 libtool 및 autoconf 때문일 수 있습니다. 다음을 실행하여 확인할 수 있습니다.

which libtool

which autoconf

내 libtool은 conda에서 왔고 autoconf는 시스템 패키지였습니다. autoconf를 제거하고 conda를 사용하여 다시 설치했습니다.

apt remove -y autoconf (우분투 / 데비안)

conda install -c anaconda autoconf

참고 : automake도 설치해야 할 수 있습니다.

conda install -c anaconda automake


버전이 다른 두 개의 libtools를 설치했을 수 있습니다. 명령 줄에 apt-get remove all입력 할 때 아무것도 얻지 못할 때까지 시도한 다음 원하는 것을 시도하십시오 .which libtoolapt-get install


aclocal을 실행 해보십시오.


시스템의 libtool을 제거하고 업스트림에서 설치하는 문제를 해결합니다. git clone git : //git.savannah.gnu.org/libtool.git

sudo apt-get install texinfo autoconf automake make
./bootstrap
./configure
하다
sudo make install

위의 어느 것도 작동하지 않았습니다.

그런 다음 이것은 작동했습니다.

autoconf -f
./configure
make

위의 어느 것도 작동하지 않았습니다. conda 환경을 비활성화 한 후 작동했습니다.

source deactivate


이 문제도 발생합니다. 제 경우에는 ./autogen.sh의 출력에 다음이 있습니다.

libtoolize: You should add the contents of the following files to 'aclocal.m4': libtoolize: '/aclocal/libtool.m4' libtoolize: '/aclocal/ltoptions.m4' libtoolize: '/aclocal/ltversion.m4' libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.ac, libtoolize: and rerunning libtoolize and aclocal. libtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am.

I just append the content the three *.m4 files under /aclocal/ to the aclocal.m4 file:

cat <a path>/aclocal/libtool.m4 <a path>/aclocal/ltoptions.m4 <a path>/aclocal/ltversion.m4 >> aclocal.m4 

then make.


here is the error:

libtool: Version mismatch error.  This is libtool 2.4.2 Debian-2.4.2-1.11, but the
libtool: definition of this LT_INIT comes from libtool 2.4.6.
libtool: You should recreate aclocal.m4 with macros from libtool 2.4.2 Debian-2.4.2-1.11
libtool: and run autoconf again.

None of the above worked.

Then this worked:

wget http://ftpmirror.gnu.org/libtool/libtool-2.4.6.tar.gz -O /root/libtool-2.4.6.tar.gz
tar xzvf /root/libtool-2.4.6.tar.gz -C /root
cp -f /usr/share/libtool/build-aux/ltmain.sh /usr/share/libtool/build-aux/ltmain_sh
cp -f /root/libtool-2.4.6/build-aux/ltmain.sh /usr/share/libtool/build-aux/ltmain.sh

autoreconf -fi
./configure
make

참고URL : https://stackoverflow.com/questions/3096989/libtool-version-mismatch-error

반응형