dependency of static library
一直以来都有一个误区,认为静态库就一定是不含任何依赖的,动态库是含的。这个印象是因为在我们程序中,包含静态库的地方,往往Build好之后直接就可以用,而含DLL的地方,则需要在build好之后的EXE中再加DLL。
那么前几天,遇到了一个问题,程序包含了A.lib之后,发现link fail. How could that be? we found that A.lib dependent on B.lib.(just trough the function name, I wonder if there is any other method)
So, the question is how could A.lib dependent on B.lib? Why B.lib is not included in A.lib?
事实很简单,静态链接库就是一个编译好的目标文件的集合,他并没有链接过,所以他不是最终的.out文件。跟可执行文件不一样。所以,这个依赖关系是可能的。当然我可以产生一个另一版本的A,可以将B完全包含在内。但是一般的A就是我们所编写的代码的和,如果有外部的LIB,就不包在里面了。VS中看有没有地方选??
所以,下一次就知道了,DLL和LIB都有可能有外部依赖。因为他们只是编译之后没有链接的半成品。
dependency of static library的更多相关文章
- Objective-C categories in static library
ASK: Can you guide me how to properly link static library to iphone project. I use staic library pro ...
- iOS制作Static Library(静态库),实现多工程的连编
在iOS开发中,我们会发现一些偏底层或基础代码是直接可以复用的,当我们换一个项目,改变的只需要是偏上层的业务逻辑代码,所以我们可以把这部分基础代码制作为一个静态库static library,并不断扩 ...
- 创建静态库Static Library(Framework库原理相似)
在项目开发的过程中,经常使用静态库文件.例如两个公司之间业务交流,不可能把源代码都发送给另一个公司,这时候将私密内容打包成静态库,别人只能调用接口,而不能知道其中实现的细节. 简介: 库是一些没有ma ...
- Can't debug c++ project because unable to static library start program *.lib
Can't debug c++ project because unable to static library start program *.lib I'm using a library ( ...
- iOS 元件组件-创建静态库static library
概述 在项目开发的过程中,经常使用静态库文件.例如两个公司之间业务交流,不可能把源代码都发送给另一个公司,这时候将私密内容打包成静态库,别人只能调用接口,而不能知道其中实现的细节. 库是一些没有mai ...
- 使用Xcode 5创建Cocoa Touch Static Library(静态库)
转自:http://blog.csdn.net/jymn_chen/article/details/21036035 首先科普一下静态库的相关知识: 程序编译一般需经预处理.编译.汇编和链接几个步骤. ...
- 区别:Use MFC In A Shared DLL 和 Use MFC In A Static Library
摘自:Programming Windows with MFC, 2nd Edition Choosing Use MFC In A Shared DLL minimizes your applica ...
- Build fat static library (device + simulator) using Xcode and SDK 4+
155down votefavorite 185 It appears that we can - theoretically - build a single static library that ...
- ios中静态库的创建和使用、制作通用静态库(Cocoa Touch Static Library)
创建静态库可能出于以下几个理由: 1.你想将工具类代码或者第三方插件快捷的分享给其他人而无需拷贝大量文件.2.你想让一些通用代码处于自己的掌控之下,以便于修复和升级.3.你想将库共享给其他人,但不想让 ...
随机推荐
- Android APP使用NDK编译后的ffmpeg库出现undefined reference to 'posix_memalign'错误
在android程序中使用NDK编译后的ffmpeg库的时候出现了如下错误: jni/libs/libavutil.a(mem.o): in function av_malloc:libavutil/ ...
- Javascript生成随机数
随机数在前后端都比较常用,用途也较广.这里记录一下前端的实现方法,代码比较简单,封装成函数可随时调用. 具体如下: function getRandNum(n){ return Math.floor( ...
- Exploratory Undersampling for Class-Imbalance Learning
Abstract - Undersampling is a popular method in dealing with class-imbalance problems, which uses on ...
- Python的平凡之路(12)
一.数据库介绍 数据库(Database)是按照数据结构来组织.存储和管理数据的仓库,每个数据库都有一个或多个不同的API用于创建,访问,管理,搜索和复制所保存的数据.我们也可以将数据存储在文件中,但 ...
- 火狐浏览器不能获取 event,解决js报错问题
//←的keyCode等于:37 //→的keyCode等于:39 //↑的keyCode等于:38 //↓的keyCode等于:40 function keystoke(obj){ //var e ...
- 411. Minimum Unique Word Abbreviation
A string such as "word" contains the following abbreviations: ["word", "1or ...
- Guess Number Higher or Lower II--困惑
今天,试着做了一下LeetCode OJ上面的第375道题:Guess Number Higher or Lower II 原题链接:https://leetcode.com/problems/gue ...
- 【LeetCode】Sort Colors
Sort Colors Given an array with n objects colored red, white or blue, sort them so that objects of t ...
- css实现隐藏显示
<head> <meta http-equiv="content-type" content="text/html;charset=utf-8" ...
- c++ 顺序容器学习
所谓容器,就是一个装东西的盒子,在c++中,我们把装的东西叫做“元素” 而顺序容器,就是说这些东西是有顺序的,你装进去是什么顺序,它们在里面就是什么顺序. c++中的顺序容器一共有这么几种: vect ...