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 ...
随机推荐
- addEventListener和on的区别
为什么需要addEventListener? 先来看一个片段: html代码 <div id="box">追梦子</div> 用on的代码 1 window ...
- 结果集(result set)解释与用法
解释: 引用自wiki: An SQL result set is a set of rows from a database, as well as metadata about the query ...
- 2015年12月12 Node.js实战(一)使用Express+MongoDB搭建多人博客
序,Node是基于V8引擎的服务器端脚本语言. 基础准备 Node.js: Express:本文用的是3.21.2版本,目前最新版本为4.13.3,Express4和Express3还是有较大区别,可 ...
- [译]Node.js面试问与答
原文: http://blog.risingstack.com/node-js-interview-questions/ 什么是error-first callback? 如何避免无休止的callba ...
- [译]Mongoose指南 - Schema
定义schema 用mongoose的第一件事情就应该是定义schema. schema是什么呢? 它类似于关系数据库的表结构. var mongoose = require('mongoose'); ...
- 在c#中运行js脚本(将js文件生成为.dll文件)
原文链接:http://www.cnblogs.com/xhan/archive/2010/10/22/1857992.html 前言: 本来在搞一个Google翻译的接口--向Google翻译发送请 ...
- OS X 10.10.5编译Android5.1.1源码
--------------------------------------------------写在前面---------------------------------------------- ...
- 中国天气预报数据API收集
{"weatherinfo":{"city":"北京","cityid":"101010100" ...
- Ajax前台调用后台方法、AJAX Pro2(回调函数)
//获取分店 function cityResult() { if (cityName != "") { $("#ddlcity_").find("o ...
- ORACLE 数据库建了非法表后无法操作和删除问题
问题描述: oracle 用PL/SQL DEVELOPER 可视化建表时,表名没有按照规范,建立一个非法格式的表 ICD-10th-Version (中间有横杆,非法).但是不知道怎么回事却建成功了 ...