在新公司工作第四天,依然要编译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的更多相关文章

  1. Linux Overflow Vulnerability General Hardened Defense Technology、Grsecurity/PaX

    Catalog . Linux attack vector . Grsecurity/PaX . Hardened toolchain . Default addition of the Stack ...

  2. 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 ...

  3. 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 ...

  4. 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 ...

  5. 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 ...

  6. Angular源码分析之$compile

    @(Angular) $compile,在Angular中即"编译"服务,它涉及到Angular应用的"编译"和"链接"两个阶段,根据从DO ...

  7. Compile FreeCAD on Windows

    Compile FreeCAD on Windows eryar@163.com 1.Introduction FreeCAD是一个参数化的三维造型软件,主要用于任意大小的实际模型的设计.参数化的建模 ...

  8. 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 ...

  9. $compile

    <html ng-app="compile"> <head> <script src="http://apps.bdimg.com/libs ...

随机推荐

  1. Git配置代理命令

    针对***的代理配置 设置代理 git config --global http.proxy 'socks5://127.0.0.1:1080' git config --global https.p ...

  2. CHNS类

    NS类集合介绍 1.常用部分 NSDictionary NSString NSArray 数组 NSTimer 定时器 NSRange 范围 NSNotification 2.网络相关 NSURLCo ...

  3. 使用Shader Graph实现《塞尔达传说:旷野之息》风格的着色器

    https://mp.weixin.qq.com/s/19Xq6wYuXP0gQJDvC9Fh0g

  4. fseek函数

    函数名:fseek函数 头文件:#include<stdio.h> 功能:把与fp有关的文件位置指针放到一个指定位置. 格式:  int fseek(FILE *stream, long ...

  5. DNS 解析域名以便通过服务器来访问的

    域名解析系统 就是把你要访问的网址转换成ip,然后你才能访问的东西 解析www.xxxx.com这类网址为IP来访问服务器 举例: 打个比方 ===>>> 你想去海底捞,但是只知道“ ...

  6. 剑指offer —— 从尾到头打印链表

    1.问题:输入一个链表,从尾到头打印链表每个节点的值. /** * public class ListNode { * int val; * ListNode next = null; * * Lis ...

  7. flask 坑

    no python application found, check your startup logs for errors 日志里面报类似于“Mon Mar 23 10:26:49 2015 – ...

  8. C语言中typedef的解释_1

    typedef是在计算机编程语言中用来为复杂的声明定义简单的别名,它与宏定义有些差异. 它本身是一种存储类的关键字,与auto.extern.mutable.static.register等关键字不能 ...

  9. Go语言基础练习题系列1

    1.练习1 题目:使用fmt分别打印字符串.二进制.十进制.十六进制.浮点数. package main import ( "fmt" ) func main() { var a ...

  10. Windows 常见DOS命令

    1. 查看网络连接及路由状况 netstat -a                 查看开启了哪些端口,常用netstat -an netstat -n                  查看端口的网 ...