因工作需要,需要用到socket网络编程的内容,在调试时从提示下面错误:
bionic/libc/kernel/common/linux/un.h:18: error: expected specifier-qualifier-list before ‘sa_family_t’
error: ‘struct sockaddr_un’ has no member named ‘sun_family’
后来发现是头文件顺序错了,#include <sys/socket.h>应该写在#include <linux/un.h>的前面,就可以编译通过了。