undefined reference to __imp_opj_xxx
keyword:
ffmpeg,openjpeg,OPJ_EXPORTS,OPJ_STATIC,opj_version,__imp_opj 出错原因:
1. __declspec(dllexport) / __declspec(dllimport)
2. __stdcall 解决方法:
openjpeg-2.1.0-modify.to.static.patch --- src/lib/openjp2/openjpeg.h.orig 2014-04-29 20:58:10 +0800
+++ src/lib/openjp2/openjpeg.h 2016-03-26 01:07:32 +0800
@@ -80,14 +80,14 @@
/* http://gcc.gnu.org/wiki/Visibility */
#if __GNUC__ >= 4
#define OPJ_API __attribute__ ((visibility ("default")))
-#define OPJ_LOCAL __attribute__ ((visibility ("hidden")))
+#define OPJ_LOCAL __attribute__ ((visibility ("default")))
#else
#define OPJ_API
#define OPJ_LOCAL
#endif
#define OPJ_CALLCONV
#else
-#define OPJ_CALLCONV __stdcall
+#define OPJ_CALLCONV
/*
The following ifdef block is the standard way of creating macros which make exporting
from a DLL simpler. All files within this DLL are compiled with the OPJ_EXPORTS
@@ -97,9 +97,9 @@
defined with this macro as being exported.
*/
#if defined(OPJ_EXPORTS) || defined(DLL_EXPORT)
-#define OPJ_API __declspec(dllexport)
+#define OPJ_API __attribute__ ((visibility ("default")))
#else
-#define OPJ_API __declspec(dllimport)
+#define OPJ_API
#endif /* OPJ_EXPORTS */
#endif /* !OPJ_STATIC || !_WIN32 */ --- src/lib/openjp3d/openjp3d.h.orig 2014-04-29 20:58:10 +0800
+++ src/lib/openjp3d/openjp3d.h 2016-03-26 00:08:35 +0800
@@ -64,9 +64,9 @@
defined with this macro as being exported.
*/
#if defined(OPJ_EXPORTS) || defined(DLL_EXPORT)
-#define OPJ_API __declspec(dllexport)
+#define OPJ_API __attribute__((visibility ("default")))
#else
-#define OPJ_API __declspec(dllimport)
+#define OPJ_API
#endif /* OPJ_EXPORTS */
#endif /* !OPJ_STATIC || !WIN32 */ --- src/lib/openmj2/openjpeg.h.orig 2014-04-29 20:58:10 +0800
+++ src/lib/openmj2/openjpeg.h 2016-03-26 00:09:40 +0800
@@ -66,9 +66,9 @@
defined with this macro as being exported.
*/
#if defined(OPJ_EXPORTS) || defined(DLL_EXPORT)
-#define OPJ_API __declspec(dllexport)
+#define OPJ_API __attribute__((visibility ("default")))
#else
-#define OPJ_API __declspec(dllimport)
+#define OPJ_API
#endif /* OPJ_EXPORTS */
#endif /* !OPJ_STATIC || !_WIN32 */ --- thirdparty/include/zconf.h.orig 2014-04-29 20:58:10 +0800
+++ thirdparty/include/zconf.h 2016-03-25 11:15:49 +0800
@@ -277,9 +277,9 @@
# ifdef ZLIB_DLL
# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
# ifdef ZLIB_INTERNAL
-# define ZEXTERN extern __declspec(dllexport)
+# define ZEXTERN extern __attribute__((visibility ("default")))
# else
-# define ZEXTERN extern __declspec(dllimport)
+# define ZEXTERN extern
# endif
# endif
# endif /* ZLIB_DLL */
@@ -306,11 +306,11 @@
#if defined (__BEOS__)
# ifdef ZLIB_DLL
# ifdef ZLIB_INTERNAL
-# define ZEXPORT __declspec(dllexport)
-# define ZEXPORTVA __declspec(dllexport)
+# define ZEXPORT __attribute__((visibility ("default")))
+# define ZEXPORTVA __attribute__((visibility ("default")))
# else
-# define ZEXPORT __declspec(dllimport)
-# define ZEXPORTVA __declspec(dllimport)
+# define ZEXPORT
+# define ZEXPORTVA
# endif
# endif
#endif
--- thirdparty/liblcms2/include/lcms2.h.orig 2016-03-26 00:00:04 +0800
+++ thirdparty/liblcms2/include/lcms2.h 2016-03-25 23:59:52 +0800
@@ -195,14 +195,14 @@
#ifdef CMS_IS_WINDOWS_
# if defined(CMS_DLL) || defined(CMS_DLL_BUILD)
# ifdef __BORLANDC__
-# define CMSEXPORT __stdcall _export
+# define CMSEXPORT __attribute__((visibility ("default")))
# define CMSAPI
# else
# define CMSEXPORT _stdcall
# ifdef CMS_DLL_BUILD
-# define CMSAPI __declspec(dllexport)
+# define CMSAPI __attribute__((visibility ("default")))
# else
-# define CMSAPI __declspec(dllimport)
+# define CMSAPI
# endif
# endif
# else
--- thirdparty/libpng/pngconf.h.orig 2014-04-29 20:58:10 +0800
+++ thirdparty/libpng/pngconf.h 2016-03-25 11:15:20 +0800
@@ -1315,9 +1315,9 @@ # ifndef PNG_IMPEXP
# ifdef PNG_BUILD_DLL
-# define PNG_IMPEXP __declspec(dllexport)
+# define PNG_IMPEXP __attribute__((visibility ("default")))
# else
-# define PNG_IMPEXP __declspec(dllimport)
+# define PNG_IMPEXP
# endif
# endif
# endif /* PNG_IMPEXP */

MinGW平台 openjpeg-2.1.0 静态编译后未定义引用的解决方法的更多相关文章

  1. (转)ThinkPHP3.0 使用分组后路径访问无效的解决方法!

    注意,清除Runtime,就是清除缓存,很重要,妹的,调试了一下午,总是加上Home目录分组就找不到页面,直接放到action下就行,原来是缓存搞得鬼,另外要在入口文件开启‘APP_DEBUG’ 在T ...

  2. SpringBoot项目编译后没有xxxmapper.xml文件解决方法

    在pom.xml文件中添加如下代码 <build> <plugins> <plugin> <groupId>org.springframework.bo ...

  3. 全志tina v3.0系统编译时的时间错误的解决(全志SDK的维护BUG)

    全志tina v3.0系统编译时的时间错误的解决(全志SDK的维护BUG) 2018/6/13 15:52 版本:V1.0 开发板:SC3817R SDK:tina v3.0 1.01原始编译全志r1 ...

  4. QT 静态编译后中文可能会出现乱码

    QT 静态编译后中文可能会出现乱码.这是因为处理文字编码的 libqcncodecs 库是以 plugin 形式存放在 QT 静态编译目录/plugs/codecs/libqcncodecs.a 文件 ...

  5. 服务器个人环境下pytorch0.4.1编译warp-ctc遇到的问题及解决方法

    一.关于warp-ctc CTC可以生成一个损失函数,用于在序列数据上进行监督式学习,不需要对齐输入数据及标签,经常连接在一个RNN网络的末端,训练端到端的语音或文本识别系统.CTC论文 CTC网络的 ...

  6. XCode编译文件过多导致内存吃紧解决方法

    XCode编译文件过多导致内存吃紧解决方法 /Users/~~/Library/Developer/Xcode/DerivedData 1) 然后 找到编译文件 删除 就好了哦 快去试试看吧

  7. Ant编译utf-8非法字符:/65279 解决方法

    原文链接:http://blog.csdn.net/xiyuan1999/article/details/5989336   Ant编译utf-8非法字符:/65279 解决方法   使用ant编译j ...

  8. 无需重新编译php加入ftp扩展的解决方法

    无需重新编译php加入ftp扩展的解决方法   本文为大家介绍无需重新编译php加入ftp扩展的方法,有需要的朋友可以参考下   首先,进入源码目录cd php-5.2.13/ext/ftp #运行p ...

  9. dotfuscator 在混淆.Net Framework 4.0以上版本的时候报错的解决方法

    dotfuscator 在混淆.Net Framework 4.0以上版本的时候报错的解决方法 在混淆的时候报错了,错误描述大致如下: Could not find a compatible vers ...

随机推荐

  1. Method Swizzling (方法调配)

    Method Swizzling是改变一个selector的实际实现的技术.通过这一技术,我们可以在运行时通过修改类的分发表中selector对应的函数,来修改方法的实现. 例如,我们想跟踪在程序中每 ...

  2. poj2391 Ombrophobic Bovines 题解

    http://poj.org/problem?id=2391 floyd+网络流+二分 题意:有一个有向图,里面每个点有ai头牛,快下雨了牛要躲进雨棚里,每个点有bi个雨棚,每个雨棚只能躲1头牛.牛可 ...

  3. A simple Snippet in ST2

    Reference: http://web-design-weekly.com/2012/07/03/snippets-in-sublime-text-2/ A sample - cofirm (To ...

  4. 2015年11月26日 Java基础系列(四)class的定义,继承和实现interface

    序,类的设计是JAVA操作的核心,面对对象思想中一切皆对象. 一.类定义中的变量 静态成员变量,为类所有,称为类变量:只有一份,编译时即分配值,使用关键字static声明. 非静态成员变量,每个实例一 ...

  5. Junit初级编码(二)探索JUnit核心

    序,Junit测试是单元测试的一个框架,提供了很多方法,供我们快速开展单元测试.现在就让我们慢慢学习Junit单元测试框架 一.Junit的三个核心概念测试类.测试集.测试运行器 1 测试类 公共的, ...

  6. Apache中,同一IP使用多域名对应多个网站的方法

    首先dns中确定有相应的A记录, abc  IN A   211.154.2.5 mail IN A   211.154.2.5 这个讲的是在windows下面配置apache虚拟主机: 一.配置虚拟 ...

  7. [Storm] java.io.FileNotFoundException: File '../stormconf.ser' does not exist

    This bug will kill supervisors Affects Version/s: 0.9.2-incubating, 0.9.3, 0.9.4 Fix Version/s: 0.10 ...

  8. maven 向本地私库导入jar

    mvn install:install-file -DgroupId=<your_group_name> -DartifactId=<your_artifact_name> - ...

  9. java web上传下载乱码问题解决方法

    文件下载中文乱码,因为http请求url和header要求只能通过ascii码,对于其他字符则不行,需要转码.而不同浏览器的处理方式右不一样. 解决方法一: /** * 乱码解决 * @throws ...

  10. Mac Pro 编译安装 PHP扩展 -- Swoole扩展

    回顾下先前的安装笔记: PHP5不重新编译,如何安装自带的未安装过的扩展,如soap扩展? #下载 Swoole-1.8.10后,开始编译# cd /Users/jianbao/Downloads/s ...