undefined reference to `typeinfo for rocksdb::Customizable'

678 views
Skip to first unread message

Hao Zhang

unread,
Jan 21, 2022, 6:48:04 PM1/21/22
to roc...@googlegroups.com
Anyone can help with this compiler error? Never seen it before...

g++  async_demo.cc -g -oasync_demo ../../rocksdb_fork/rocksdb/librocksdb.a -I../../rocksdb_fork/rocksdb/include -I../include -I../../liburing/src/include -L../../liburing/src/ -fno-rtti -std=c++20 -fcoroutines -luring -D_GUN_SOURCE -fpermissive -lpthread -lrt -ldl -lsnappy -lgflags -lz -lbz2 -llz4 -lzstd -lnuma -ltcmalloc -std=c++20  -faligned-new -DHAVE_ALIGNED_NEW -DROCKSDB_PLATFORM_POSIX -DROCKSDB_LIB_IO_POSIX  -DOS_LINUX -fno-builtin-memcmp -DROCKSDB_FALLOCATE_PRESENT -DSNAPPY -DGFLAGS=1 -DZLIB -DBZIP2 -DLZ4 -DZSTD -DNUMA -DROCKSDB_MALLOC_USABLE_SIZE -DROCKSDB_PTHREAD_ADAPTIVE_MUTEX -DROCKSDB_BACKTRACE -DROCKSDB_RANGESYNC_PRESENT -DROCKSDB_SCHED_GETCPU_PRESENT -DROCKSDB_AUXV_GETAUXVAL_PRESENT -march=native   -DHAVE_SSE42  -DHAVE_PCLMUL  -DHAVE_AVX2  -DHAVE_BMI  -DHAVE_LZCNT -DHAVE_UINT128_EXTENSION -DROCKSDB_SUPPORT_THREAD_LOCAL   -ldl -lpthread
/usr/bin/ld: ../../rocksdb_fork/rocksdb/librocksdb.a(remove_emptyvalue_compactionfilter.o):(.data.rel.ro._ZTIN7rocksdb16CompactionFilterE[_ZTIN7rocksdb16CompactionFilterE]+0x10): undefined reference to `typeinfo for rocksdb::Customizable'
/usr/bin/ld: ../../rocksdb_fork/rocksdb/librocksdb.a(merge_operator.o):(.data.rel.ro._ZTIN7rocksdb13MergeOperatorE[_ZTIN7rocksdb13MergeOperatorE]+0x10): undefined reference to `typeinfo for rocksdb::Customizable'

Yanqin Jin

unread,
Jan 21, 2022, 6:54:09 PM1/21/22
to Hao Zhang, rocksdb
Maybe it's because compile with `-fno-rtti`?

From: roc...@googlegroups.com <roc...@googlegroups.com> on behalf of Hao Zhang <kenn...@gmail.com>
Sent: Friday, January 21, 2022 3:47 PM
To: roc...@googlegroups.com <roc...@googlegroups.com>
Subject: undefined reference to `typeinfo for rocksdb::Customizable'
 
--
You received this message because you are subscribed to the Google Groups "rocksdb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rocksdb+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rocksdb/CAGXpB2mZi6Ybz44eCdFkg4F_F9OB0vxuGzykCDtpQTXBzTiQrg%40mail.gmail.com.

Hao Zhang

unread,
Jan 21, 2022, 7:00:31 PM1/21/22
to Yanqin Jin, rocksdb
I removed -fno-rtti when linking still the same error. Or I also need to ensure when librocksdb.a is compiled, it also doesn't have -fno-rtti?

g++  async_demo.cc -g -oasync_demo ../../rocksdb_fork/rocksdb/librocksdb.a -I../../rocksdb_fork/rocksdb/include -I../include -I../../liburing/src/include -L../../liburing/src/ -frtti -std=c++20 -fcoroutines -luring -D_GUN_SOURCE -fpermissive -lpthread -lrt -ldl -lsnappy -lgflags -lz -lbz2 -llz4 -lzstd -lnuma -ltcmalloc -std=c++20  -faligned-new -DHAVE_ALIGNED_NEW -DROCKSDB_PLATFORM_POSIX -DROCKSDB_LIB_IO_POSIX  -DOS_LINUX -fno-builtin-memcmp -DROCKSDB_FALLOCATE_PRESENT -DSNAPPY -DGFLAGS=1 -DZLIB -DBZIP2 -DLZ4 -DZSTD -DNUMA -DROCKSDB_MALLOC_USABLE_SIZE -DROCKSDB_PTHREAD_ADAPTIVE_MUTEX -DROCKSDB_BACKTRACE -DROCKSDB_RANGESYNC_PRESENT -DROCKSDB_SCHED_GETCPU_PRESENT -DROCKSDB_AUXV_GETAUXVAL_PRESENT -march=native   -DHAVE_SSE42  -DHAVE_PCLMUL  -DHAVE_AVX2  -DHAVE_BMI  -DHAVE_LZCNT -DHAVE_UINT128_EXTENSION -DROCKSDB_SUPPORT_THREAD_LOCAL   -ldl -lpthread

/usr/bin/ld: ../../rocksdb_fork/rocksdb/librocksdb.a(remove_emptyvalue_compactionfilter.o):(.data.rel.ro._ZTIN7rocksdb16CompactionFilterE[_ZTIN7rocksdb16CompactionFilterE]+0x10): undefined reference to `typeinfo for rocksdb::Customizable'
/usr/bin/ld: ../../rocksdb_fork/rocksdb/librocksdb.a(merge_operator.o):(.data.rel.ro._ZTIN7rocksdb13MergeOperatorE[_ZTIN7rocksdb13MergeOperatorE]+0x10): undefined reference to `typeinfo for rocksdb::Customizable'
collect2: error: ld returned 1 exit status

Yanqin Jin

unread,
Jan 21, 2022, 7:02:41 PM1/21/22
to Hao Zhang, rocksdb
I think so

From: Hao Zhang <kenn...@gmail.com>
Sent: Friday, January 21, 2022 4:00 PM
To: Yanqin Jin <yan...@fb.com>
Cc: rocksdb <roc...@googlegroups.com>
Subject: Re: undefined reference to `typeinfo for rocksdb::Customizable'
 

Hao Zhang

unread,
Jan 21, 2022, 7:04:12 PM1/21/22
to Yanqin Jin, rocksdb
What has changed? I looked at the default makefile in Rocksdb, it seems always set -fno-rtti and it worked fine before....

Yanqin Jin

unread,
Jan 21, 2022, 7:10:26 PM1/21/22
to Hao Zhang, rocksdb
Not sure. If this is broken recently, then we should fix it.
Can you help by doing a make clean and then make? If it still fails after a clean, feel free to open a Github issue with steps to repro. Thanks!

From: Hao Zhang <kenn...@gmail.com>
Sent: Friday, January 21, 2022 4:03 PM
Reply all
Reply to author
Forward
0 new messages