error in header file socket.h
4 次查看(过去 30 天)
显示 更早的评论
Hi, I encouter this error while compilation after adding the header file socket.h to the include repertory of visual studio.10 and I am using matlab 2013. this is the log error file :
perform_front_propagation_anisotropic.cpp
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(119) : error C2146: syntax error : missing ';' before identifier 'sa_len'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(119) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(119) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(120) : error C2146: syntax error : missing ';' before identifier 'sa_family'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(120) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(120) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(129) : error C2146: syntax error : missing ';' before identifier 'sp_family'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(129) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(129) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(130) : error C2146: syntax error : missing ';' before identifier 'sp_protocol'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(130) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(130) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(173) : error C2146: syntax error : missing ';' before identifier 'msg_name'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(173) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(173) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(174) : error C2146: syntax error : missing ';' before identifier 'msg_namelen'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(174) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(174) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(176) : error C2146: syntax error : missing ';' before identifier 'msg_iovlen'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(176) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(176) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(177) : error C2146: syntax error : missing ';' before identifier 'msg_control'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(177) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(177) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(178) : error C2146: syntax error : missing ';' before identifier 'msg_controllen'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(178) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(178) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(197) : error C2146: syntax error : missing ';' before identifier 'cmsg_len'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(197) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(197) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(222) : error C2146: syntax error : missing ';' before identifier 'sa_family'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(222) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(222) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(230) : error C2146: syntax error : missing ';' before identifier 'msg_name'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(230) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(230) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(234) : error C2146: syntax error : missing ';' before identifier 'msg_accrights'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(234) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(234) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\sys/socket.h(240) : fatal error C1083: Cannot open include file: 'sys/cdefs.h': No such file or directory
any help would be appreciated;
2 个评论
Walter Roberson
2016-5-2
For a C++ program, shouldn't you #include <socket> rather than #include <socket.h> ?
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!