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.97k stars 1.98k forks source link

libserverframe 编译报错 ‘struct fast_task_info’ has no member named ‘XXX’ #649

Open Ghost-Unison opened 1 year ago

Ghost-Unison commented 1 year ago

libfastcommon编译安装成功了,没有报错。 但是libserverframe编译报错, 这是路径: image image

这是编译时的报错: 看是提示说fast_task_info这个对象里面缺少好多成员变量,我是按着wiki里的步骤一步步操作的,直接克隆的github上最新的libfastcommon和libserverframe的包。是我linux环境里缺少什么吗,求助 image

gcc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -fPIC -c -o sf_nio.lo sf_nio.c  -Iinclude -I/usr/local/include
In file included from sf_nio.c:41:0:
sf_global.h: In function ‘sf_set_global_base_path’:
sf_global.h:278:5: warning: implicit declaration of function ‘normalize_path’ [-Wimplicit-function-declaration]
     normalize_path(NULL, &path_string, SF_G_BASE_PATH_STR,
     ^
sf_nio.c: In function ‘release_iovec_buffer’:
sf_nio.c:87:13: error: ‘struct fast_task_info’ has no member named ‘iovec_array’
     if (task->iovec_array.iovs != NULL) {
             ^
sf_nio.c:91:13: error: ‘struct fast_task_info’ has no member named ‘iovec_array’
         task->iovec_array.iovs = NULL;
             ^
sf_nio.c:92:13: error: ‘struct fast_task_info’ has no member named ‘iovec_array’
         task->iovec_array.count = 0;
             ^
sf_nio.c: In function ‘sf_nio_notify’:
sf_nio.c:367:9: error: ‘struct fast_task_info’ has no member named ‘notify_next’
     task->notify_next = NULL;
         ^
sf_nio.c:372:46: error: ‘struct fast_task_info’ has no member named ‘notify_next’
         task->thread_data->waiting_queue.tail->notify_next = task;
                                              ^
sf_nio.c: In function ‘sf_recv_notify_read’:
sf_nio.c:436:26: error: ‘struct fast_task_info’ has no member named ‘notify_next’
         current = current->notify_next;
                          ^
sf_nio.c: In function ‘check_task’:
sf_nio.c:487:5: warning: implicit declaration of function ‘tcp_socket_connected’ [-Wimplicit-function-declaration]
     if (tcp_socket_connected(task->event.fd)) {
     ^
sf_nio.c: In function ‘sf_client_sock_read’:
sf_nio.c:556:21: error: ‘struct fast_task_info’ has no member named ‘recv_body’
             if (task->recv_body == NULL) {
                     ^
sf_nio.c:559:40: error: ‘struct fast_task_info’ has no member named ‘recv_body’
                 bytes = read(sock, task->recv_body + (task->offset -
                                        ^
sf_nio.c:643:21: error: ‘struct fast_task_info’ has no member named ‘recv_body’
                 task->recv_body = SF_CTX->alloc_recv_buffer(task,
                     ^
sf_nio.c:645:38: error: ‘struct fast_task_info’ has no member named ‘recv_body’
                 if (new_alloc && task->recv_body == NULL) {
                                      ^
sf_nio.c: In function ‘sf_client_sock_write’:
sf_nio.c:730:17: error: ‘struct fast_task_info’ has no member named ‘iovec_array’
         if (task->iovec_array.iovs != NULL) {
                 ^
sf_nio.c:731:38: error: ‘struct fast_task_info’ has no member named ‘iovec_array’
             bytes = writev(sock, task->iovec_array.iovs,
                                      ^
In file included from /usr/include/fastcommon/shared_func.h:26:0,
                 from sf_nio.c:33:
sf_nio.c:732:32: error: ‘struct fast_task_info’ has no member named ‘iovec_array’
                     FC_MIN(task->iovec_array.count, IOV_MAX));
                                ^
sf_nio.c:732:53: error: ‘IOV_MAX’ undeclared (first use in this function)
                     FC_MIN(task->iovec_array.count, IOV_MAX));
                                                     ^
sf_nio.c:732:53: note: each undeclared identifier is reported only once for each function it appears in
sf_nio.c:732:32: error: ‘struct fast_task_info’ has no member named ‘iovec_array’
                     FC_MIN(task->iovec_array.count, IOV_MAX));
                                ^
sf_nio.c:791:17: error: ‘struct fast_task_info’ has no member named ‘iovec_array’
         if (task->iovec_array.iovs != NULL) {
                 ^
sf_nio.c:797:23: error: ‘struct fast_task_info’ has no member named ‘iovec_array’
             iov = task->iovec_array.iovs;
                       ^
sf_nio.c:798:23: error: ‘struct fast_task_info’ has no member named ‘iovec_array’
             end = task->iovec_array.iovs + task->iovec_array.count;
                       ^
sf_nio.c:798:48: error: ‘struct fast_task_info’ has no member named ‘iovec_array’
             end = task->iovec_array.iovs + task->iovec_array.count;
                                                ^
sf_nio.c:815:17: error: ‘struct fast_task_info’ has no member named ‘iovec_array’
             task->iovec_array.iovs = iov;
                 ^
sf_nio.c:816:17: error: ‘struct fast_task_info’ has no member named ‘iovec_array’
             task->iovec_array.count = end - iov;
                 ^
make: *** [sf_nio.lo] Error 1
happyfish100 commented 1 year ago

可能是安装过libfastcommon早期的版本,可以执行如下命令: /bin/rm -rf /usr/local/lib/libfastcommon.so /usr/local/include/fastcommon