okapis:fastDFS 1.8在64位freebsd7.0下编译出错

发布于 2022-09-23 15:32:28 字数 3456 浏览 13 评论 0

okapis:freebsd6.*可以正常编译通过,在7.0下编译出错,
错误信息如下:
# ./make.sh -f Makefile.freebsd
cc -Wall -O2 -D_FILE_OFFSET_BITS=64 -DOS_FREEBSD -o fdfs_trackerd fdfs_trackerd.c  ../common/hash.o ../common/fdfs_define.o ../common/chain.o  ../common/shared_func.o ../common/ini_file_reader.o  ../common/logger.o ../common/sockopt.o ../common/fdfs_global.o  tracker_proto.o tracker_mem.o tracker_service.o  tracker_global.o tracker_func.o  -L/usr/local/lib -lc_r -I../common -I../tracker -I/usr/local/include
fdfs_trackerd.c: In function 'main':
fdfs_trackerd.c:188: warning: cast to pointer from integer of different size
/usr/bin/ld: cannot find -lc_r
*** Error code 1

Stop in /dist/FastDFS/tracker.
cc -Wall -O2 -D_FILE_OFFSET_BITS=64 -DOS_FREEBSD -o fdfs_storaged fdfs_storaged.c  ../common/hash.o ../common/fdfs_define.o ../common/chain.o  ../common/shared_func.o ../common/ini_file_reader.o  ../common/logger.o ../common/sockopt.o ../common/fdfs_global.o  ../common/fdfs_base64.o  ../tracker/tracker_proto.o tracker_client_thread.o  storage_global.o storage_func.o storage_service.o  storage_sync.o  -L/usr/local/lib -lc_r -I../common -I../tracker -I/usr/local/include
fdfs_storaged.c: In function 'main':
fdfs_storaged.c:249: warning: cast to pointer from integer of different size
/usr/bin/ld: cannot find -lc_r
*** Error code 1

Stop in /dist/FastDFS/storage.
cc -Wall -O2 -D_FILE_OFFSET_BITS=64 -DOS_FREEBSD -o fdfs_monitor fdfs_monitor.c  ../common/hash.o ../common/fdfs_define.o ../common/chain.o  ../common/shared_func.o ../common/ini_file_reader.o  ../common/logger.o ../common/sockopt.o ../common/fdfs_global.o  ../common/fdfs_base64.o  ../tracker/tracker_proto.o tracker_client.o client_func.o  client_global.o storage_client.o  -L/usr/local/lib -lc_r -I../common -I../tracker -I/usr/local/include
fdfs_monitor.c: In function 'main':
fdfs_monitor.c:86: warning: format '%lld' expects type 'long long int', but argument 4 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 7 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 8 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 9 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 10 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 11 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 12 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 13 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 14 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 15 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 16 has type 'int64_t'
/usr/bin/ld: cannot find -lc_r
*** Error code 1

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

岁月蹉跎了容颜 2022-09-30 15:32:29

happy_fish100:应该修改文件Makefile.freebsd。我看你贴的出错信息和上次的是一样的,是不是修改成Makefile了?
Wty:我修改的就是makefile.freebsd 这是其中的一个
.SUFFIXES: .c .o

COMPILE = $(CC) -Wall -O2 -D_FILE_OFFSET_BITS=64 -DOS_FREEBSD
#COMPILE = $(CC) -Wall -g -D_FILE_OFFSET_BITS=64 -DOS_FREEBSD -D__DEBUG__
INC_PATH = -I../common -I../tracker -I/usr/local/include
TARGET_PATH = /usr/local/bin
COMMON_LIB =
SHARED_OBJS = ../common/hash.o ../common/fdfs_define.o ../common/chain.o \
              ../common/shared_func.o ../common/ini_file_reader.o \
              ../common/logger.o ../common/sockopt.o ../common/fdfs_global.o \
              ../common/fdfs_base64.o \
              ../tracker/tracker_proto.o tracker_client_thread.o \
              storage_global.o storage_func.o storage_service.o \
              storage_sync.o

ALL_OBJS = $(SHARED_OBJS)

ALL_PRGS = fdfs_storaged

all: $(ALL_OBJS) $(ALL_PRGS)
.o:
$(COMPILE) -o $@ $<  $(SHARED_OBJS) $(COMMON_LIB) $(LIB_PATH) $(INC_PATH)
.c:
$(COMPILE) -o $@ $<  $(ALL_OBJS) $(COMMON_LIB) $(LIB_PATH) $(INC_PATH)
.c.o:
$(COMPILE) -c -o $@ $<  $(INC_PATH)
install:
cp -f $(ALL_PRGS) $(TARGET_PATH)
clean:
rm -f $(ALL_OBJS) $(ALL_PRGS)

断舍离 2022-09-30 15:32:29

Wty:修改的是storage 和tracker 下面的makefile.freebsd
一直编译不过去
有解决的办法吗
不会必须将系统做到6以下把???

happy_fish100:我这边没有bsd7的编译环境。去掉-lc_r后,能否把错误信息重新贴一下啊?你上面贴的貌似不对啊。
Makefile.freebsd中,你进行如下设置
LIB_PATH = -L/usr/local/lib -lpthread
试试能否编译通过。

Wty:你看看错在哪里了 谢谢
storage 下makefile.freebsd

.SUFFIXES: .c .o

COMPILE = $(CC) -Wall -O2 -D_FILE_OFFSET_BITS=64 -DOS_FREEBSD
#COMPILE = $(CC) -Wall -g -D_FILE_OFFSET_BITS=64 -DOS_FREEBSD -D__DEBUG__
INC_PATH = -I../common -I../tracker -I/usr/local/include
LIB_PATH = -L/usr/local/lib -lpthread
TARGET_PATH = /usr/local/bin
COMMON_LIB =
SHARED_OBJS = ../common/hash.o ../common/fdfs_define.o ../common/chain.o \
              ../common/shared_func.o ../common/ini_file_reader.o \
              ../common/logger.o ../common/sockopt.o ../common/fdfs_global.o \
              ../common/fdfs_base64.o \
              ../tracker/tracker_proto.o tracker_client_thread.o \
              storage_global.o storage_func.o storage_service.o \
              storage_sync.o

ALL_OBJS = $(SHARED_OBJS)

ALL_PRGS = fdfs_storaged

all: $(ALL_OBJS) $(ALL_PRGS)
.o:
$(COMPILE) -o $@ $<  $(SHARED_OBJS) $(COMMON_LIB) $(LIB_PATH) $(INC_PATH)
.c:
$(COMPILE) -o $@ $<  $(ALL_OBJS) $(COMMON_LIB) $(LIB_PATH) $(INC_PATH)
.c.o:
$(COMPILE) -c -o $@ $<  $(INC_PATH)
install:
cp -f $(ALL_PRGS) $(TARGET_PATH)
clean:
rm -f $(ALL_OBJS) $(ALL_PRGS)

tracker 下makefile.freebsd

.SUFFIXES: .c .o

COMPILE = $(CC) -Wall -O2 -D_FILE_OFFSET_BITS=64 -DOS_FREEBSD
#COMPILE = $(CC) -Wall -g -D_FILE_OFFSET_BITS=64 -DOS_FREEBSD -D__DEBUG__
INC_PATH = -I../common -I../tracker -I/usr/local/include
LIB_PATH = -L/usr/local/lib -lpthread
TARGET_PATH = /usr/local/bin

COMMON_LIB =
SHARED_OBJS = ../common/hash.o ../common/fdfs_define.o ../common/chain.o \
              ../common/shared_func.o ../common/ini_file_reader.o \
              ../common/logger.o ../common/sockopt.o ../common/fdfs_global.o \
              tracker_proto.o tracker_mem.o tracker_service.o \
              tracker_global.o tracker_func.o

ALL_OBJS = $(SHARED_OBJS)

ALL_PRGS = fdfs_trackerd

all: $(ALL_OBJS) $(ALL_PRGS)
.o:
$(COMPILE) -o $@ $<  $(SHARED_OBJS) $(COMMON_LIB) $(LIB_PATH) $(INC_PATH)
.c:
$(COMPILE) -o $@ $<  $(ALL_OBJS) $(COMMON_LIB) $(LIB_PATH) $(INC_PATH)
.c.o:
$(COMPILE) -c -o $@ $<  $(INC_PATH)
install:
cp -f $(ALL_PRGS) $(TARGET_PATH)
clean:
rm -f $(ALL_OBJS) $(ALL_PRGS)

编译出错信息

cc -Wall -O2 -D_FILE_OFFSET_BITS=64 -DOS_FREEBSD -o fdfs_trackerd fdfs_trackerd.c  ../common/hash.o ../common/fdfs_define.o ../common/chain.o  ../common/shared_func.o ../common/ini_file_reader.o  ../common/logger.o ../common/sockopt.o ../common/fdfs_global.o  tracker_proto.o tracker_mem.o tracker_service.o  tracker_global.o tracker_func.o  -L/usr/local/lib -lpthread -I../common -I../tracker -I/usr/local/include
fdfs_trackerd.c: In function 'main':
fdfs_trackerd.c:188: warning: cast to pointer from integer of different size
cc -Wall -O2 -D_FILE_OFFSET_BITS=64 -DOS_FREEBSD -o fdfs_storaged fdfs_storaged.c  ../common/hash.o ../common/fdfs_define.o ../common/chain.o  ../common/shared_func.o ../common/ini_file_reader.o  ../common/logger.o ../common/sockopt.o ../common/fdfs_global.o  ../common/fdfs_base64.o  ../tracker/tracker_proto.o tracker_client_thread.o  storage_global.o storage_func.o storage_service.o  storage_sync.o  -L/usr/local/lib -lpthread -I../common -I../tracker -I/usr/local/include
fdfs_storaged.c: In function 'main':
fdfs_storaged.c:249: warning: cast to pointer from integer of different size
cc -Wall -O2 -D_FILE_OFFSET_BITS=64 -DOS_FREEBSD -o fdfs_monitor fdfs_monitor.c  ../common/hash.o ../common/fdfs_define.o ../common/chain.o  ../common/shared_func.o ../common/ini_file_reader.o  ../common/logger.o ../common/sockopt.o ../common/fdfs_global.o  ../common/fdfs_base64.o  ../tracker/tracker_proto.o tracker_client.o client_func.o  client_global.o storage_client.o  -L/usr/local/lib -lc_r -I../common -I../tracker -I/usr/local/include
fdfs_monitor.c: In function 'main':
fdfs_monitor.c:86: warning: format '%lld' expects type 'long long int', but argument 4 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 7 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 8 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 9 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 10 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 11 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 12 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 13 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 14 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 15 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 16 has type 'int64_t'
/usr/bin/ld: cannot find -lc_r
*** Error code 1

Stop in /dist/FastDFS/client.

错误好像是一样的

阳光下慵懒的猫 2022-09-30 15:32:29

happy_fish100:看你贴出的编译信息,tracker和storage应该都编译通过了,warning信息是没问题的,可以忽略。trakcer和storage这两个目录下的Makefile.freebsd你应该都修改过了。client目录下的Makefile.freebsd还需要修改一下,然后重新编译应该就可以了。

Wty:谢谢。编译通过,我试试客户端调用

happy_fish100:V1.10统一了FreeBSD和Linux下的编译方法,解决了在FreeBSD7.0下编译出错的问题。欢迎大家下载使用。

寄居人 2022-09-30 15:32:29

支持~~~不错~~~呵呵~~~

锦爱 2022-09-30 15:32:29

不错~~~支持~~~呵呵~~~~

喜爱纠缠 2022-09-30 15:32:28

happy_fish100:我在FreeBSD 4.11上测试通过的。看来BSD 7上没有动态库libc_r.so了。你试试修改一下Makefile,将-lc_r 删除后试试能否编译通过。

okapis:还是编译出错
删除以后 依然编译不通过

happy_fish100:什么出错信息呢,能否贴上来看看?

okapis:错误信息和上次是一样的
这个全部的出错信息 freebsd6编译通过
cc -Wall -O2 -D_FILE_OFFSET_BITS=64 -DOS_FREEBSD -o fdfs_trackerd fdfs_trackerd.c  ../common/hash.o ../common/fdfs_define.o ../common/chain.o  ../common/shared_func.o ../common/ini_file_reader.o  ../common/logger.o ../common/sockopt.o ../common/fdfs_global.o  tracker_proto.o tracker_mem.o tracker_service.o  tracker_global.o tracker_func.o  -L/usr/local/lib -lc_r -I../common -I../tracker -I/usr/local/include
fdfs_trackerd.c: In function 'main':
fdfs_trackerd.c:188: warning: cast to pointer from integer of different size
/usr/bin/ld: cannot find -lc_r
*** Error code 1

Stop in /dist/FastDFS/tracker.
cc -Wall -O2 -D_FILE_OFFSET_BITS=64 -DOS_FREEBSD -o fdfs_storaged fdfs_storaged.c  ../common/hash.o ../common/fdfs_define.o ../common/chain.o  ../common/shared_func.o ../common/ini_file_reader.o  ../common/logger.o ../common/sockopt.o ../common/fdfs_global.o  ../common/fdfs_base64.o  ../tracker/tracker_proto.o tracker_client_thread.o  storage_global.o storage_func.o storage_service.o  storage_sync.o  -L/usr/local/lib -lc_r -I../common -I../tracker -I/usr/local/include
fdfs_storaged.c: In function 'main':
fdfs_storaged.c:249: warning: cast to pointer from integer of different size
/usr/bin/ld: cannot find -lc_r
*** Error code 1

Stop in /dist/FastDFS/storage.
cc -Wall -O2 -D_FILE_OFFSET_BITS=64 -DOS_FREEBSD -o fdfs_monitor fdfs_monitor.c  ../common/hash.o ../common/fdfs_define.o ../common/chain.o  ../common/shared_func.o ../common/ini_file_reader.o  ../common/logger.o ../common/sockopt.o ../common/fdfs_global.o  ../common/fdfs_base64.o  ../tracker/tracker_proto.o tracker_client.o client_func.o  client_global.o storage_client.o  -L/usr/local/lib -lc_r -I../common -I../tracker -I/usr/local/include
fdfs_monitor.c: In function 'main':
fdfs_monitor.c:86: warning: format '%lld' expects type 'long long int', but argument 4 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 7 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 8 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 9 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 10 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 11 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 12 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 13 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 14 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 15 has type 'int64_t'
fdfs_monitor.c:140: warning: format '%lld' expects type 'long long int', but argument 16 has type 'int64_t'
/usr/bin/ld: cannot find -lc_r
*** Error code 1

Stop in /dist/FastDFS/client.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文