MinGW平台 openjpeg-2.1.0 静态编译后未定义引用的解决方法
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 静态编译后未定义引用的解决方法的更多相关文章
- (转)ThinkPHP3.0 使用分组后路径访问无效的解决方法!
注意,清除Runtime,就是清除缓存,很重要,妹的,调试了一下午,总是加上Home目录分组就找不到页面,直接放到action下就行,原来是缓存搞得鬼,另外要在入口文件开启‘APP_DEBUG’ 在T ...
- SpringBoot项目编译后没有xxxmapper.xml文件解决方法
在pom.xml文件中添加如下代码 <build> <plugins> <plugin> <groupId>org.springframework.bo ...
- 全志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 ...
- QT 静态编译后中文可能会出现乱码
QT 静态编译后中文可能会出现乱码.这是因为处理文字编码的 libqcncodecs 库是以 plugin 形式存放在 QT 静态编译目录/plugs/codecs/libqcncodecs.a 文件 ...
- 服务器个人环境下pytorch0.4.1编译warp-ctc遇到的问题及解决方法
一.关于warp-ctc CTC可以生成一个损失函数,用于在序列数据上进行监督式学习,不需要对齐输入数据及标签,经常连接在一个RNN网络的末端,训练端到端的语音或文本识别系统.CTC论文 CTC网络的 ...
- XCode编译文件过多导致内存吃紧解决方法
XCode编译文件过多导致内存吃紧解决方法 /Users/~~/Library/Developer/Xcode/DerivedData 1) 然后 找到编译文件 删除 就好了哦 快去试试看吧
- Ant编译utf-8非法字符:/65279 解决方法
原文链接:http://blog.csdn.net/xiyuan1999/article/details/5989336 Ant编译utf-8非法字符:/65279 解决方法 使用ant编译j ...
- 无需重新编译php加入ftp扩展的解决方法
无需重新编译php加入ftp扩展的解决方法 本文为大家介绍无需重新编译php加入ftp扩展的方法,有需要的朋友可以参考下 首先,进入源码目录cd php-5.2.13/ext/ftp #运行p ...
- dotfuscator 在混淆.Net Framework 4.0以上版本的时候报错的解决方法
dotfuscator 在混淆.Net Framework 4.0以上版本的时候报错的解决方法 在混淆的时候报错了,错误描述大致如下: Could not find a compatible vers ...
随机推荐
- array_fill 用给定的值填充数组
转自:http://www.phpstudy.net/php/165.html PHP array_fill 用给定的值填充数组 array_fill (PHP 4 >= 4.2.0, PHP ...
- 结果集(result set)解释与用法
解释: 引用自wiki: An SQL result set is a set of rows from a database, as well as metadata about the query ...
- EF-联合查询-结果集-Group by-统计数目
EF框架用着痛并且快乐着··· 毕竟用习惯了SQL语句直接硬查的··· SELECT C0.ID,C_C.Name,C_C.C_COUNT FROM article_type C0 INNER JOI ...
- POJ 2031 Building a Space Station
3维空间中的最小生成树....好久没碰关于图的东西了..... Building a Space Station Time Limit: 1000MS Memory Li ...
- 如何用SQL命令行工具删除dedecms指定id文章
用dedecms采集时标题字段设置错了,出现了注释符号<!---->,导致后台的文章列表出现错误,也无法直接从列表中删除,可以远程登录数据库去操作,这个相对比较麻烦,想着直接从后台的SQL ...
- 【C语言入门教程】3.3 条件控制语句
在程序的 3 种基本结构中,第二种是选择结构,选择结构是根据程序运行时获得的条件,决定程序执行情况.条件控制语句可用来实现这种结构,C 语言提供了 if 语句和 switch 语句两种条件控制语句,i ...
- SDK 移动应用开发系统
AppCan SDK 是一套跨平台移动应用开发系统,基于业内领先的Hybrid App 开发引擎,采用HTML5 标准作为开发语言,支持一次开发多平台适配.AppCan SDK 提供应用向导和界面向导 ...
- HDU HDU1558 Segment set(并查集+判断线段相交)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1558 解题报告:首先如果两条线段有交点的话,这两条线段在一个集合内,如果a跟b在一个集合内,b跟c在一 ...
- httpd-2.2 配置及用法完全攻略
导读 apache是一款稳定的流行的web软件,是linux操作系统中默认的web管理软件.在RHEL/Centos系列中可以用rpm直接进行安装,服务名为httpd.apache有很多设置和调优 的 ...
- aspcms 留言 搜索
留言: <form method='POST' name='myform' onSubmit='return metmessagesubmit("姓名不能为空"," ...