我具有以下目录结构-
YCSB-C/
- db/
- cceh_store.h (includes <src/CCEH.h>)
- cceh_store.cc (includes cceh_store.h, <util/hash.h>)
- cceh_store.o
- Makefile (1 - builds cceh_store.o)
- ycsb.cc
- Makefile (2 - builds target 'ycsbc' from ycsb.cc by linking it with cceh_store.o)
CCEH/
- src/
- CCEH.h (defines class CCEH)
- CCEH_MSB.cc (implements CCEH methods, includes util/hash.h, util/persist.h)
- CCEH_MSB.o
- util/
- hash.h
- persist.h
- Makefile (3 - builds CCEH_MSB.o)
CCEH_MSB.o
目标文件- g++ -std=c++17 -I./ -lpthread -O3 -c -o src/CCEH_MSB.o src/CCEH_MSB.cpp -DINPLACE
cceh_store.o
对象文件,该文件成功完成- g++-8 -std=c++14 -c -g -Wall -pthread -I../ -I../../CCEH cceh_store.cc -o cceh_store.o
ycsbc
- g++ -std=c++11 -g -Wall -pthread -I./ -I../CCEH/ ycsbc.cc db/cceh_store.o ../CCEH/src/CCEH_MSB.o -o ycsbc
它失败并显示以下错误-
../CCEH/src/CCEH_MSB.o: In function `xxhash(void const*, unsigned long, unsigned long)':
CCEH_MSB.cpp:(.text+0x330): multiple definition of `xxhash(void const*, unsigned long, unsigned long)'
db/cceh_store.o:/home/osboxes/YCSB-C/db/../../CCEH/util/hash.h:236: first defined here
CCEH_MSB.cpp:(.text+0xdea): undefined reference to `kWriteLatencyInNS'
在这里,kWriteLatencyInNS
在CCEH/util/persist.h
中定义
我已经花了几个小时,但是我无法弄清楚如何使ycsbc
正确构建。我该如何解决?