Compile with Visual Studio 2013

1,000 views
Skip to first unread message

rmfc

unread,
Dec 9, 2014, 5:29:38 PM12/9/14
to uni...@googlegroups.com
Hi,
There's an error compiling UniMRCP in VS2013:

>  stun_common.c
1>..\..\libsofia-sip-ua\stun\stun_common.c(787): error C2220: warning treated as error - no 'object' file generated
1>..\..\libsofia-sip-ua\stun\stun_common.c(787): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
1>          C:\Program Files (x86)\Windows Kits\8.1\Include\um\winsock2.h(1868) : see declaration of 'inet_ntoa'
1>..\..\libsofia-sip-ua\stun\stun_common.c(790): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
1>          C:\Program Files (x86)\Windows Kits\8.1\Include\um\winsock2.h(1868) : see declaration of 'inet_ntoa'
1>  stun.c
1>..\..\libsofia-sip-ua\stun\stun.c(2192): error C2220: warning treated as error - no 'object' file generated
1>..\..\libsofia-sip-ua\stun\stun.c(2192): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
1>          C:\Program Files (x86)\Windows Kits\8.1\Include\um\winsock2.h(1868) : see declaration of 'inet_ntoa'


And since warnings are treated as errors, UniMRCP fails to compile.
I've added preprocessor flag: _WINSOCK_DEPRECATED_NO_WARNINGS



Arsen Chaloyan

unread,
Dec 10, 2014, 11:01:44 PM12/10/14
to UniMRCP
Hi Renato,

I remember having fixed a number of compilation errors in the dependencies introduced since VS2013, but interestingly enough, I don't encounter this particular one. What version of VS2013 do you use? I mean the edition, update, etc. Any other relevant information which may matter?

--
You received this message because you are subscribed to the Google Groups "UniMRCP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unimrcp+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Arsen Chaloyan
Author of UniMRCP
http://www.unimrcp.org

Renato

unread,
Dec 11, 2014, 11:14:11 AM12/11/14
to uni...@googlegroups.com
Hi Arsen,
I'm using Visual Studio 2013 update 4 with Windows SDK 8.1

Renato

Arsen Chaloyan

unread,
Dec 11, 2014, 10:58:22 PM12/11/14
to UniMRCP
Thanks Renato. It turns out Microsoft has deprecated inet_ntoa() and other related functions since VS2013 Update 3. So, I second your suggestion and come up with the following change in Sofia-SIP's win32\config.h, which will be included in future releases of dependencies.

---
 win32/config.h.in | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/win32/config.h.in b/win32/config.h.in
index f846840..4d77798 100644
--- a/win32/config.h.in
+++ b/win32/config.h.in
@@ -520,6 +520,10 @@
 #endif
 #endif // VC8+
 #endif
+/* Disable warnings related to the use of inet_ntoa() and friends */
+#if defined(_MSC_PT_VER) && (_MSC_PT_VER >= 120)
+#define _WINSOCK_DEPRECATED_NO_WARNINGS
+#endif
Reply all
Reply to author
Forward
0 new messages