在新公司工作第四天,依然要编译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. spring mvc常用注解标签

    @Controller 在SpringMVC 中,控制器Controller 负责处理由DispatcherServlet 分发的请求,它把用户请求的数据经过业务处理层处理之后封装成一个Model , ...

  2. [SinGuLaRiTy] NOIP 膜你赛-Day 2

    [SinGuLaRiTy-1031] Copyright (c) SinGuLaRiTy 2017. All Rights Reserved. 对于所有题目: Time Limit: 1s | Mem ...

  3. 【bzoj3209】: 花神的数论题 数论-DP

    [bzoj3209]: 花神的数论题 首先二进制数中1的个数最多就是64个 设所有<=n的数里二进制中1的个数为i的有a[i]个 那么答案就是  然后快速幂 求a[i]可以用DP 设在二进制中从 ...

  4. [转]关于TDD、BDD和DDD的一些看法

    在实际的项目中,我们可能随时面对各种不同的需求,它的各个方面的要素决定了我们所采用的开发模式. 比如,它的复杂度如何?所有的需求是否足够清晰?开发人员对相关的业务是否足够了解?项目的工期是否合理?种种 ...

  5. 【记录一下】从0到1 我的python开发之路

    请设计实现一个商城系统,商城主要提供两个功能:商品管理.会员管理. 商品管理: - 查看商品列表 - 根据关键字搜索指定商品 - 录入商品 会员管理:[无需开发,如选择则提示此功能不可用,正在开发中, ...

  6. Pre- and Post-order Traversals(先序+后序序列,建立二叉树)

    PAT甲级1119,我先在CSDN上面发布的这篇文章:https://blog.csdn.net/weixin_44385565/article/details/89737224 Suppose th ...

  7. P2264 情书

    传送门 正常会想到字典树 然鹅数据怎么小直接map也能过 然后就写map暴力匹配了 毫无思维难度,毫无代码难度 注意逗号算单词分隔符,如果有句号就算另一句 同一句的单词重复出现只计算一次贡献 再开个m ...

  8. HDU1085 Holding Bin-Laden Captive!

    Description We all know that Bin-Laden is a notorious terrorist, and he has disappeared for a long t ...

  9. JS匿名函数以及arguments.callee的调用

    var res = (function (n) {    if( n>1 ) {        return n + arguments.callee( n-1 );    } else {   ...

  10. 找到一篇关于 Oracle 全文检索实践 的文章

    http://www.iteye.com/topic/1118055 有详细的例子记录了Oracle 全文检索的使用.