error C2275: 'SOCKET' : illegal use of this type as an expression

  在VC中编译xxx.c文件出现错误error C2275 illegal use of this type as an expression 

  问题在于C99之前要求所有的声明必须放在函数块的起始部分,这也是C和C++的重要区别。

  方法:

  1). 修改成xxx.cpp 。

  2). 把声明放在函数起始部分。

  参考:http://stackoverflow.com/questions/9549521/compiler-error-c2275

猜你喜欢

转载自www.cnblogs.com/MakeView660/p/9233853.html