免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2950 | 回复: 6
打印 上一主题 下一主题

[FastDFS] okapis:fastDFS 1.8在64位freebsd7.0下编译出错 [复制链接]

论坛徽章:
4
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:56:11IT运维版块每日发帖之星
日期:2016-08-11 06:20:00IT运维版块每日发帖之星
日期:2016-08-15 06:20:00
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-02-21 09:54 |只看该作者 |倒序浏览
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

论坛徽章:
4
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:56:11IT运维版块每日发帖之星
日期:2016-08-11 06:20:00IT运维版块每日发帖之星
日期:2016-08-15 06:20:00
2 [报告]
发表于 2009-02-21 09:57 |只看该作者

动态库的问题

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.

论坛徽章:
4
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:56:11IT运维版块每日发帖之星
日期:2016-08-11 06:20:00IT运维版块每日发帖之星
日期:2016-08-15 06:20:00
3 [报告]
发表于 2009-02-21 09:58 |只看该作者

回复:动态库的问题

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)

论坛徽章:
4
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:56:11IT运维版块每日发帖之星
日期:2016-08-11 06:20:00IT运维版块每日发帖之星
日期:2016-08-15 06:20:00
4 [报告]
发表于 2009-02-21 10:01 |只看该作者

Wty:修改

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.



错误好像是一样的

论坛徽章:
4
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:56:11IT运维版块每日发帖之星
日期:2016-08-11 06:20:00IT运维版块每日发帖之星
日期:2016-08-15 06:20:00
5 [报告]
发表于 2009-02-21 10:02 |只看该作者

回复:你看看错在哪里了 谢谢

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

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

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

论坛徽章:
0
6 [报告]
发表于 2009-06-16 10:23 |只看该作者
支持~~~不错~~~呵呵~~~

论坛徽章:
0
7 [报告]
发表于 2009-06-16 10:30 |只看该作者
不错~~~支持~~~呵呵~~~~
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP