---
title: "libtool 2.2.6b以后链接时间接依赖丢时导致的undefined symbol的解决方法"
author: "chenqi210"
date: "2016-11-24T20:26:08Z"
tags: []
categories: ["开源软件"]
slug: "libtool-2-2-6b-undefined-symbol"
draft: false
lastmod: "2016-11-24T20:29:18Z"
id: 2340956
url: "https://chenqi210.iteye.com/blog/2340956"
---

在debian 或者ubuntu这类操作系统上libtool从2.2.6b版本开始，间接依赖库会在链接时被丢掉。导致会发生莫名奇妙的undefined symbol。

 

http://stackoverflow.com/questions/11802727/libtool-doesnt-provide-library-dependencies-to-link 写道

4  
down vote  
accepted

On any Debian machine I use for development, I have to compile and install Libtool by hand, because the Debian-supplied version is patched and ignores dependencies in a way that break my builds.

If Ubuntu's version is similar, you might want to install Libtool from source too.

 

libtool源代码的地址在这里[http://ftp.gnu.org/gnu/libtool/](http://ftp.gnu.org/gnu/libtool/ "http://ftp.gnu.org/gnu/libtool/")

 

我们可以下载下来和现在用的libtool作比较. 然后把link\_all\_deplibs=no这类的地方改为和用源代码生成的libtool一致。如果还是没用，全部用yes就可以了。