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 ...
随机推荐
- Hadoop之HDFS文件操作常有两种方式(转载)
摘要:Hadoop之HDFS文件操作常有两种方式,命令行方式和JavaAPI方式.本文介绍如何利用这两种方式对HDFS文件进行操作. 关键词:HDFS文件 命令行 Java API HD ...
- Oracle11安装
图片上传失败,重新编辑 1.选择安装目录,一般设置数据库口令为system 2.环境检查 3.注册页面,直接下一步 4.点击安装按钮 5.进入安装界面 6.等待 7.直到出现下面界面,点击口令管理 8 ...
- redhat 下 rpm 指令
1.如何安装rpm软件包rmp软件包的安装可以使用程序rpm来完成.执行下面的命令 rpm -i your-package.rpm 其中your-package.rpm是你要安装的rpm包的文件名,一 ...
- 创业15条经验总结:温饱之后,创业公司CEO如何树“三观”?
都说创业改变命运,事实上不是,创业,时时刻刻,可能连“命”都保不住!创业公司最重要的只有“活下去”.满足了这个.才有资格谈其他.公司连饭都开不了,还谈什么其他?创业公司如果连生存问题都解决不了,高位的 ...
- Mac Pro Office Word 2011 个性化设置
操作系统:Mac Pro OS X 10.11.5 1.常用的几个操作: (1).视图 -> 功能区 (2).视图 -> 打印版式 (3).视图 -> 大纲 (4).视图 -> ...
- 使用ASP.Net WebAPI构建REST服务(一)——简单的示例
由于给予REST的Web服务非常简单易用,它越来越成为企业后端服务集成的首选方法.本文这里介绍一下如何通过微软的Asp.Net WebAPI快速构建REST-ful 服务. 首先创建一个Asp.Net ...
- C\C++ sizeof 陷阱&&总结
今天使用动态数组,本来想通过sizeof 获取动态数据,结果出现了错误. 先对自己做个测试,能做出下面这个题目,并做出合理解释,可以不用往下看了. ][]; cout<< cout< ...
- eclipse emacs
eclipse emacs 插件 http://www.mulgasoft.com/emacsplus eclipse字体设置: 一.把字体设置为Courier New 操作步骤:打开Elcipse ...
- JVM内存监控工具 Jconsole
-------------Jconsole监视远程的linux服务器上的tomcat ----------------------------- 1.linux服务器上的tomcat 的bin/cat ...
- Effective Java 读书笔记之七 通用程序设计
一.将局部变量的作用域最小化 1.在第一次使用变量的地方声明 2.几乎每个变量的声明都应该包含一个初始化表达式:try-catch语句是一个例外 3.使方法小而集中是一个好的策略 二.for-each ...