compile with -fPIC
在新公司工作第四天,依然要编译FFmpeg,不同的是难度大了,以前遇到什么参数编译不过的,就去掉,因为不是专业做视频的,但是新公司绕不过了。
编译FFmpeg动态库的时候发现链接某些静态库的时候会报错:
relocation R_X86_64_32S against `cmnMemAlloc' can not be used when making a shared object; recompile with -fPIC
基础不扎实,不知道make的时候还可以添加参数,查了很多资料,最后从一个回答中试出解决方案:
再编译存在问题的库时,调用“make”命令的时候,添加“CFLAGS='-fpic'”参数,就可以了。
举个栗子:
我编译FFmpeg时报这样的错:
/usr/bin/ld: /usr/local/lib/libvo-amrwbenc.a(wrapper.o): relocation R_X86_64_32S against `cmnMemAlloc' can not be used when making a shared object; recompile with -fPIC
意思是链接的“libvo-amrwbenc.a”库需要添加“-fPIC”重新编译,那我就在编译“libvo-amrwbenc.a”时,调用
make CFLAGS='$CFLAGS -fpic'
有的./configure 时也有这样的参数“CFLAGS”,也可以在这里添加
编译动态库要链接静态库才会出现这问题,编译静态库链接静态库则不会
有个回答如是说:
compile with -fPIC的更多相关文章
- Linux Overflow Vulnerability General Hardened Defense Technology、Grsecurity/PaX
Catalog . Linux attack vector . Grsecurity/PaX . Hardened toolchain . Default addition of the Stack ...
- How to compile and install Snort from source code on Ubuntu
http://www.tuicool.com/articles/v6j2Ab Snort is by far the most popular open-source network intrusio ...
- crosss compile VLC with OpenMAX on ARM board(RockChip RK3399),in order to use Hard Acceleration when decode video
reference:http://www.x90x90x90.com/en/raspberry-pi-3-howto-compile-vlc-with-hardware-acceleration/ 1 ...
- Windows 10上源码编译glog和gflags 编写glog-config.cmake和gflags-config.cmake | compile glog and glags on windows from source
本文首发于个人博客https://kezunlin.me/post/bb64e398/,欢迎阅读! compile glog v0.3.5 and glags on windows from sour ...
- Ubuntu 16.04上源码编译和安装pytorch教程,并编写C++ Demo CMakeLists.txt | tutorial to compile and use pytorch on ubuntu 16.04
本文首发于个人博客https://kezunlin.me/post/54e7a3d8/,欢迎阅读最新内容! tutorial to compile and use pytorch on ubuntu ...
- Angular源码分析之$compile
@(Angular) $compile,在Angular中即"编译"服务,它涉及到Angular应用的"编译"和"链接"两个阶段,根据从DO ...
- Compile FreeCAD on Windows
Compile FreeCAD on Windows eryar@163.com 1.Introduction FreeCAD是一个参数化的三维造型软件,主要用于任意大小的实际模型的设计.参数化的建模 ...
- maven 加入json-lib.jar 报错 Missing artifact net.sf.json-lib:json-lib:jar:2.4:compile
<dependency> <groupId>net.sf.json-lib</groupId> <artifactId>json-lib</art ...
- $compile
<html ng-app="compile"> <head> <script src="http://apps.bdimg.com/libs ...
随机推荐
- EIP权限工作流升级说明-2019/3/5
首页增加待办事项直接处理按钮 2,新增处理历史记录
- Metasploit 读书笔记-神器Meterpreter
一、基本命令 截屏 screenshot 2.获取系统平台信息 sysinfo 3.进程信息 ps 4.获取键盘记录 查看进程信息ps--migrate将会话迁移至explorer.exe进程空间中- ...
- Ground Truth
ground truth就是参考标准,一般用来做误差量化.比方说要根据历史数据预测某一时间的温度,ground truth就是那个时间的真实温度.error就是(predicted temperatu ...
- 洛谷P3258 [JLOI2014]松鼠的新家(树上差分+树剖)
题目描述 松鼠的新家是一棵树,前几天刚刚装修了新家,新家有n个房间,并且有n-1根树枝连接,每个房间都可以相互到达,且俩个房间之间的路线都是唯一的.天哪,他居然真的住在”树“上. 松鼠想邀请小熊维尼前 ...
- HTML5应用——生日快乐动画之星星
在讲述绘制星星动画之前,先介绍一点javascript知识. 面向对象: javascript本质上不是面向对象语言,而是脚本语言,一般只适合简单.代码量少的程序,因为脚本过于复杂会直接导致浏览器出现 ...
- LCA【洛谷P2971】 [USACO10HOL]牛的政治Cow Politics
P2971 [USACO10HOL]牛的政治Cow Politics 农夫约翰的奶牛住在N (2 <= N <= 200,000)片不同的草地上,标号为1到N.恰好有N-1条单位长度的双向 ...
- Redis学习笔记(4)—— Jedis入门
一.Jedis介绍 Redis不仅是使用命令来操作,现在基本上主流的语言都有客户端支持,比如Java.C.C#.C++.php.Node.js.Go等. 在官方网站里列的一些Java客户端,有jedi ...
- android:id 中区别。。
一. android:id="@android:id/tabhost" 是调用系统内部的ID 和代码中 mTabContent = (FrameLayout) findView ...
- 单片机关键字sfr和sbit的理解
在单片机C语言编程中,扩充了两个关键字sfr和sbit.sfr(Special Function Register特殊功能寄存器的缩写),sbit(特殊功能寄存器位),与定义一般的int.char型变 ...
- springMvc使用restful风格
转载:https://blog.csdn.net/weide_java/article/details/53793769 1,REST架构师一个抽象的概念,目前主要是基于HTTP协议实现,其目的是为了 ...