文档章节

multiple definition of ‘***’ between crypto.a and

bobway
 bobway
发布于 2015/05/25 13:46
字数 845
阅读 40
收藏 0

今天我在编译我的Cocos2dx项目时,它报错说我重复定义了,因为我需要在代码中使用openssl库,就把它添加到了第三方库的文件夹里,之后在编译时,报出错误说是openssl的静态库中一些东东被curl的静态库给定义了,就产生了这个错误,具体报错如下:

/home/bob/WorkSpace/Cocox2d/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: jni/../../cocos2d/external/openssl/armeabi-v7a/lib/libssl.a(ssl_lib.o): multiple definition of 'SSL_set_cipher_list'
/home/bob/WorkSpace/Cocox2d/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: jni/../../cocos2d/external/curl/prebuilt/android/armeabi-v7a/libcurl.a(ssl_lib.o): previous definition here
/home/bob/WorkSpace/Cocox2d/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: jni/../../cocos2d/external/openssl/armeabi-v7a/lib/libssl.a(ssl_lib.o): multiple definition of 'SSL_get_shared_ciphers'
/home/bob/WorkSpace/Cocox2d/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: jni/../../cocos2d/external/curl/prebuilt/android/armeabi-v7a/libcurl.a(ssl_lib.o): previous definition here
/home/bob/WorkSpace/Cocox2d/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: jni/../../cocos2d/external/openssl/armeabi-v7a/lib/libssl.a(ssl_lib.o): multiple definition of 'ssl_cipher_list_to_bytes'
/home/bob/WorkSpace/Cocox2d/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: jni/../../cocos2d/external/curl/prebuilt/android/armeabi-v7a/libcurl.a(ssl_lib.o): previous definition here
/home/bob/WorkSpace/Cocox2d/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: jni/../../cocos2d/external/openssl/armeabi-v7a/lib/libssl.a(ssl_lib.o): multiple definition of 'ssl_bytes_to_cipher_list'
/home/bob/WorkSpace/Cocox2d/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: jni/../../cocos2d/external/curl/prebuilt/android/armeabi-v7a/libcurl.a(ssl_lib.o): previous definition here
/home/bob/WorkSpace/Cocox2d/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: jni/../../cocos2d/external/openssl/armeabi-v7a/lib/libssl.a(ssl_lib.o): multiple definition of 'SSL_get_servername'
/home/bob/WorkSpace/Cocox2d/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: jni/../../cocos2d/external/curl/prebuilt/android/armeabi-v7a/libcurl.a(ssl_lib.o): previous definition here
/home/bob/WorkSpace/Cocox2d/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: jni/../../cocos2d/external/openssl/armeabi-v7a/lib/libssl.a(ssl_lib.o): multiple definition of 'SSL_get_servername_type'
/home/bob/WorkSpace/Cocox2d/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: jni/../../cocos2d/external/curl/prebuilt/android/armeabi-v7a/libcurl.a(ssl_lib.o): previous definition here
/home/bob/WorkSpace/Cocox2d/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: jni/../../cocos2d/external/openssl/armeabi-v7a/lib/libssl.a(ssl_lib.o): multiple definition of 'SSL_select_next_proto'
/home/bob/WorkSpace/Cocox2d/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: jni/../../cocos2d/external/curl/prebuilt/android/armeabi-v7a/libcurl.a(ssl_lib.o): previous definition here
/home/bob/WorkSpace/Cocox2d/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: jni/../../cocos2d/external/openssl/armeabi-v7a/lib/libssl.a(ssl_lib.o): multiple definition of 'SSL_get0_next_proto_negotiated'
/home/bob/WorkSpace/Cocox2d/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: jni/../../cocos2d/external/curl/prebuilt/android/armeabi-v7a/libcurl.a(ssl_lib.o): previous definition here
/home/bob/WorkSpace/Cocox2d/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: jni/../../cocos2d/external/openssl/armeabi-v7a/lib/libssl.a(ssl_lib.o): multiple definition of 'SSL_CTX_set_next_protos_advertised_cb'
/home/bob/WorkSpace/Cocox2d/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: jni/../../cocos2d/external/curl/prebuilt/android/armeabi-v7a/libcurl.a(ssl_lib.o): previous definition here
/home/bob/WorkSpace/Cocox2d/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: jni/../../cocos2d/external/openssl/armeabi-v7a/lib/libssl.a(ssl_lib.o): multiple definition of 'SSL_CTX_set_next_proto_select_cb'
/home/bob/WorkSpace/Cocox2d/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: jni/../../cocos2d/external/curl/prebuilt/android/armeabi-v7a/libcurl.a(ssl_lib.o): previous definition here
/home/bob/WorkSpace/Cocox2d/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: jni/../../cocos2d/external/openssl/armeabi-v7a/lib/libssl.a(ssl_lib.o): multiple definition of 'SSL_CTX_set_alpn_protos'
/home/bob/WorkSpace/Cocox2d/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: jni/../../cocos2d/external/curl/prebuilt/android/armeabi-v7a/libcurl.a(ssl_lib.o): previous definition here

这是一部分的报错,但也能说明问题了,然后我就开始寻找怎么解决它。

最后用的方法是,在/proj.android/jni/Android.mk 文件中,加上下面这句话:

LOCAL_LDFLAGS := -Wl,--allow-multiple-definition

然后,就可以正常编译了,但我不太清楚会不会有什么不好的影响,希望有了解的可以指点一下。

© 著作权归作者所有

上一篇: Ubuntu修改用户名
下一篇: C++ 正则表达式
bobway
粉丝 4
博文 118
码字总数 25402
作品 0
成都
私信 提问
friso ,各种php扩展安装不上。

@狮子的魂 你好,想跟你请教个问题: CentOS 7.2 64位 , php 5.6.10 friso 1.6.1 robbe-1.6.0 编译安装friso没问题,生成php扩展,friso.so没问题。 但在修改php.ini中 添加extension 中,重...

VicMing
2017/08/16
129
4
Spring Cloud Data Flow 1.0 GA 发布

Spring Cloud Data Flow 1.0 GA 发布了,包括以下更新: Spring Cloud Data Flow’s Apache YARN Server 1.0 GA Spring Cloud Data Flow’s Kubernetes Server 1.0 GA Spring Cloud Data Fl......

oschina
2016/07/13
953
1
The Descent to C

Introduction This article attempts to give a sort of ‘orientation tour’ for people whose previous programming background is in high (ish) level languages such as Java or Pyth......

LsDimplex
2016/10/22
12
0
算法学习笔记(五)---reorder string

微软线上测试最简单的一道题,直接贴上来好了。。。 题目: Description For this question, your program is required to process an input string containing only ASCII characters betw......

夏尘安
2014/04/13
57
0
Dialing Up Your Application's Release Cadence

When trying to get to Continuous Integration (most enterprises are not really there yet - nightly build isn’t CI), or trying to get to Continuous Delivery or Deployment from m......

Paul Hammant
2017/12/26
0
0

没有更多内容

加载失败,请刷新页面

加载更多

面向对象编程

1、类和对象 类是对象的蓝图和模板,而对象是实例;即对象是具体的实例,类是一个抽象的模板 当我们把一大堆拥有共同特征的对象的静态特征(属性)和动态特征(行为)都抽取出来后,就可以定...

huijue
今天
8
0
redis异常解决 :idea启动本地redis出现 jedis.exceptions.JedisDataException: NOAUTH Authentication required

第一次安装在本地redis服务,试试跑项目,结果却出现nested exception is redis.clients.jedis.exceptions.JedisDataException: NOAUTH Authentication required错误,真是让人头疼 先检查一...

青慕
今天
20
0
Spring 之 IoC 源码分析 (基于注解方式)

一、 IoC 理论 IoC 全称为 Inversion of Control,翻译为 “控制反转”,它还有一个别名为 DI(Dependency Injection),即依赖注入。 二、IoC方式 Spring为IoC提供了2种方式,一种是基于xml...

星爵22
今天
28
0
Docker安装PostgresSql

Docker安装PostgresSql 拉取docker镜像 # docker pull postgres:10.1010.10: Pulling from library/postgres9fc222b64b0a: Pull complete 38296355136d: Pull complete 2809e135bbdb: Pu......

Tree
今天
11
0
内容垂直居中

方法一: 采用上下 padding 形式,将内容放置在垂直居中 .line { padding: 2% 0; text-align: center; height: 5px;} <div class="line"> 内容垂直居中</div> 方法二: 采......

低至一折起
今天
22
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部