/home/hongli.yin/work/dev/mongo/src/mongo/db/modules/hsdb/src/db.cpp:168: undefined reference to `CityHash64(char const*, unsigned long)'
collect2: error: ld returned 1 exit status
scons: *** [build/opt/mongo/mongod] Error 1
Here is my SConscript file:
1 Import("env")
2
3 env.Library(
4 target= 'storage_hsdb_lib',
5 source= [
6 'src/db.cpp',
7 'src/block_manager.cpp',
8 ],
9 LIBDEPS= ['/usr/local/lib/cityhash']
10 )
11
12 env.Library(
13 target= 'storage_hsdb_base',
14 source= [
15 'hsdb_engine.cpp',
16 'hsdb_record_store.cpp',
17 'hsdb_recovery_unit.cpp',
18 'hsdb_index.cpp',
19 'hsdb_global_options.cpp',
20 ],
21 LIBDEPS= [
22 'storage_hsdb_lib',
23 '$BUILD_DIR/mongo/bson/bson',
24 '$BUILD_DIR/mongo/db/namespace_string',
25 '$BUILD_DIR/mongo/db/catalog/collection_options',
26 '$BUILD_DIR/mongo/db/concurrency/write_conflict_exception',
27 '$BUILD_DIR/mongo/db/index/index_descriptor',
28 '$BUILD_DIR/mongo/db/storage/bson_collection_catalog_entry',
29 '$BUILD_DIR/mongo/db/storage/index_entry_comparison',
30 '$BUILD_DIR/mongo/db/storage/key_string',
31 '$BUILD_DIR/mongo/db/storage/oplog_hack',
32 '$BUILD_DIR/mongo/util/foundation',
33 '$BUILD_DIR/mongo/util/processinfo',
34 '$BUILD_DIR/third_party/shim_snappy',
35 ]
36 )
37
38 env.Library(
39 target= 'storage_hsdb',
40 source= [
41 'hsdb_init.cpp',
42 'hsdb_options_init.cpp',
43 'hsdb_parameters.cpp',
44 'hsdb_record_store_mongod.cpp',
45 'hsdb_server_status.cpp',
46 ],
47 LIBDEPS= [
48 'storage_hsdb_base',
49 '$BUILD_DIR/mongo/db/storage/kv/kv_engine',
50 ],
51 LIBDEPS_DEPENDENTS=['$BUILD_DIR/mongo/db/${LIBPREFIX}serveronly${LIBSUFFIX}']
52 )
53
54 env.Library(
55 target= 'storage_hsdb_mock',
56 source= [
57 'hsdb_record_store_mock.cpp',
58 ],
59 LIBDEPS= [
60 'storage_hsdb_base',
61 ]
62 )
63
64 #env.CppUnitTest(
65 # target='storage_rocks_index_test',
66 # source=['src/rocks_index_test.cpp'
67 # ],
68 # LIBDEPS=[
69 # 'storage_rocks_mock',
70 # '$BUILD_DIR/mongo/db/storage/sorted_data_interface_test_harness'
71 # ]
72 # )
73
74 #env.CppUnitTest(
75 # target='storage_hsdb_record_store_test',
76 # source=['hsdb_record_store_test.cpp'
77 # ],
78 # LIBDEPS=[
79 # 'storage_hsdb_mock',
80 # '$BUILD_DIR/mongo/db/storage/record_store_test_harness'
81 # ]
82 #
83
84 env.CppUnitTest(
85 target='storage_hsdb_engine_test',
86 source=['hsdb_engine_test.cpp'
87 ],
88 LIBDEPS=[
89 'storage_hsdb_mock',
90 '$BUILD_DIR/mongo/db/storage/kv/kv_engine_test_harness',
91 ]
92 )
I am building a storage engine and I would like to include a third party library. I've already put libcityhash.a in /usr/local/lib/. But the compiler gives me this error:/home/hongli.yin/work/dev/mongo/src/mongo/db/modules/hsdb/src/db.cpp:168: undefined reference to `CityHash64(char const*, unsigned long)'
collect2: error: ld returned 1 exit status
scons: *** [build/opt/mongo/mongod] Error 1
Here is my SConscript file:
1 Import("env")
2
3 env.Library(
4 target= 'storage_hsdb_lib',
5 source= [
6 'src/db.cpp',
7 'src/block_manager.cpp',
8 ],
9 LIBDEPS= ['/usr/local/lib/cityhash']