happyfish100 / fastdfs

FastDFS is an open source high performance distributed file system (DFS). It's major functions include: file storing, file syncing and file accessing, and design for high capacity and load balance. Wechat/Weixin public account (Chinese Language): fastdfs
GNU General Public License v3.0
8.91k stars 1.97k forks source link

make.sh error: 'ConnectionInfo' {aka 'struct <anonymous>'} has no member named 'af' on version 6.12.0 #695

Closed fubingting closed 4 months ago

fubingting commented 4 months ago

Compiling 6.11.0 in the same way succeeded, but 6.12.0 failed. Dependent version: libfastcommon@1.0.72 and libserverframe@1.2.2. os: CentOS-8 gcc:8.5.0 The detailed error report is as follows:

==> [2024-02-19-11:39:46.036543] '/usr/bin/sh' 'make.sh'
gcc -Wall -Wformat-truncation=0 -Wformat-overflow=0 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o tracker_proto.o tracker_proto.c  -I../common -I/usr/local/include
tracker_proto.c: In function 'tracker_connect_server_no_pool_ex':
tracker_proto.c:506:17: error: 'ConnectionInfo' {aka 'struct <anonymous>'} has no member named 'af'
             conn->af == AF_INET ? bind_addr4 : bind_addr6, log_connect_error);
                 ^~
tracker_proto.c:525:33: error: 'ConnectionInfo' {aka 'struct <anonymous>'} has no member named 'af'
                             conn->af == AF_INET ? bind_addr4 :
                                 ^~
make: *** [Makefile:28: tracker_proto.o] Error 1
gcc -Wall -Wformat-truncation=0 -Wformat-overflow=0 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o ../tracker/fdfs_shared_func.o ../tracker/fdfs_shared_func.c  -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon
../tracker/fdfs_shared_func.c: In function 'fdfs_parse_server_info_ex':
../tracker/fdfs_shared_func.c:491:17: warning: implicit declaration of function 'getIpaddrByNameEx'; did you mean 'getIpaddrByName'? [-Wimplicit-function-declaration]
             if (getIpaddrByNameEx(hosts[i], conn->ip_addr,
                 ^~~~~~~~~~~~~~~~~
                 getIpaddrByName
../tracker/fdfs_shared_func.c:492:53: error: 'ConnectionInfo' {aka 'struct <anonymous>'} has no member named 'af'
                         sizeof(conn->ip_addr), &conn->af) == INADDR_NONE)
                                                     ^~
../tracker/fdfs_shared_func.c:503:17: error: 'ConnectionInfo' {aka 'struct <anonymous>'} has no member named 'af'
             conn->af = is_ipv6_addr(conn->ip_addr) ? AF_INET6 : AF_INET;
                 ^~
make: *** [Makefile:38: ../tracker/fdfs_shared_func.o] Error 1
gcc -Wall -Wformat-truncation=0 -Wformat-overflow=0 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o ../tracker/tracker_proto.o ../tracker/tracker_proto.c  -I../common -I../tracker -I/usr/include/fastcommon
../tracker/tracker_proto.c: In function 'tracker_connect_server_no_pool_ex':
../tracker/tracker_proto.c:506:17: error: 'ConnectionInfo' {aka 'struct <anonymous>'} has no member named 'af'
             conn->af == AF_INET ? bind_addr4 : bind_addr6, log_connect_error);
                 ^~
../tracker/tracker_proto.c:525:33: error: 'ConnectionInfo' {aka 'struct <anonymous>'} has no member named 'af'
                             conn->af == AF_INET ? bind_addr4 :
                                 ^~
make: *** [Makefile:62: ../tracker/tracker_proto.o] Error 1
fubingting commented 4 months ago

The problem has been resolved because / usr/include/fastcommon is specified in make.sh, but my fastcommon is installed in another folder