windows编译freeswitch-1.8.5

我的windows环境是WIN10 编译器是vs2022

下载好freeswitch-1.8.5代码解压后 直接打开sln文件,开始编译。报错如下:

6>libsrtp.lib(crypto_kernel.obj) : error LNK2005: SocketNotificationRetrieveEvents 已经在 libsrtp.lib(srtp.obj) 中定义
6>libsrtp.lib(alloc.obj) : error LNK2005: SocketNotificationRetrieveEvents 已经在 libsrtp.lib(srtp.obj) 中定义
6>libsrtp.lib(datatypes.obj) : error LNK2005: SocketNotificationRetrieveEvents 已经在 libsrtp.lib(srtp.obj) 中定义
6>libsrtp.lib(err.obj) : error LNK2005: SocketNotificationRetrieveEvents 已经在 libsrtp.lib(srtp.obj) 中定义
6>libsrtp.lib(rdbx.obj) : error LNK2005: SocketNotificationRetrieveEvents 已经在 libsrtp.lib(srtp.obj) 中定义
6>libsrtp.lib(rdb.obj) : error LNK2005: SocketNotificationRetrieveEvents 已经在 libsrtp.lib(srtp.obj) 中定义
6>libsrtp.lib(cipher.obj) : error LNK2005: SocketNotificationRetrieveEvents 已经在 libsrtp.lib(srtp.obj) 中定义
6>libsrtp.lib(auth.obj) : error LNK2005: SocketNotificationRetrieveEvents 已经在 libsrtp.lib(srtp.obj) 中定义
6>libsrtp.lib(key.obj) : error LNK2005: SocketNotificationRetrieveEvents 已经在 libsrtp.lib(srtp.obj) 中定义
6>libsrtp.lib(ekt.obj) : error LNK2005: SocketNotificationRetrieveEvents 已经在 libsrtp.lib(srtp.obj) 中定义
6>libsrtp.lib(stat.obj) : error LNK2005: SocketNotificationRetrieveEvents 已经在 libsrtp.lib(srtp.obj) 中定义
6>libsrtp.lib(null_cipher.obj) : error LNK2005: SocketNotificationRetrieveEvents 已经在 libsrtp.lib(srtp.obj) 中定义
6>libsrtp.lib(aes_icm_ossl.obj) : error LNK2005: SocketNotificationRetrieveEvents 已经在 libsrtp.lib(srtp.obj) 中定义
6>libsrtp.lib(aes_gcm_ossl.obj) : error LNK2005: SocketNotificationRetrieveEvents 已经在 libsrtp.lib(srtp.obj) 中定义
6>libsrtp.lib(null_auth.obj) : error LNK2005: SocketNotificationRetrieveEvents 已经在 libsrtp.lib(srtp.obj) 中定义
6>libsrtp.lib(hmac_ossl.obj) : error LNK2005: SocketNotificationRetrieveEvents 已经在 libsrtp.lib(srtp.obj) 中定义

经过比价发现这些文件有共同点就是包含了datatypes.h 经过确认是这个头文件引起的报错。

改法如下:把datatypes.h里面的# include <winsock2.h>替换成_declspec(dllimport) unsigned long ntohl(unsigned long netlong);

posted on 2023-06-05 18:18  弘道者  阅读(350)  评论(0)    收藏  举报