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 ...
随机推荐
- centos yum 安装
LINUX下YUM源配置 1.确保RHEL5中已经安装了yum [root@lvs-master ~]# rpm -qa |grep yumyum-metadata-parser-1.1.2-3.el ...
- MFC中文件的查找、创建、打开、读写等
http://blog.csdn.net/whatforever/article/details/6316416
- 阿里云9折推荐码:0LGVW2
阿里云9折推荐码:0LGVW2,第一次购买云服务器或云数据库可享受原价9折优惠.
- Excel 使用宏批量修改单元格内指定文字为红字
-> step 1:新建宏,进入编辑,使用如下代码: Sub Ss()Dim c As RangeFor Each c In ActiveSheet.UsedRange i = 1 While ...
- CodeForces 353B Two Heaps
B. Two Heaps Valera has 2·n cubes, each cube contains an integer from 10 to 99. He arbitrarily cho ...
- QT点击"X"按钮,调用closeEvent()函数来实现调用特定事件(附:粗略介绍QT的信号与槽的使用方法)
背景: QT在用户关闭窗口(直接点击"X"键)时,程序一般都需要做一些善后的事情,就我现在的程序来说,既关闭USB.如何实现? 正文: 首先,在对应窗体的".h" ...
- Ubuntu 14 常用“快捷键”,Ctrl + Alt + F1 进入终端,按 Ctrl + Alt + F7 回到界面
Ubuntu中所谓 Super键,就是 Windows建,一般在键盘的 ctrl 和 alt 2个键之间,一个微软窗口的图标. 1.持续按住 Super键,会弹出“键盘快捷键”大全: 2.修改快捷键路 ...
- asp.net的sql防注入和去除html标记的方法
一. // <summary> /// 过滤标记 /// </summary> /// <param name="NoHTML">包括HTML, ...
- Lua模块测试
Lua模块 ---------------------------------------------------------- ----------------------- 模块测试module_ ...
- ii7安装php
http://www.jb51.net/article/22372.htm 我们知道php配置有几种: 1.CGI方式加载PHP环境,通常就是IIS里面配置解释器为php.exe,早期比较常见,目前使 ...