Compiling failed.
samson-wang opened this issue · 5 comments
Got info as following:
Linking CXX executable ../bin/logkafka
librdkafka/lib/librdkafka.a(rdkafka_broker.o): In function rd_kafka_broker_produce_toppar': /data/home/samson/repo/logkafka.git/_build/src/librdkafka/src/project_librdkafka/src/rdkafka_broker.c:2101: undefined reference to
crc32'
/data/home/samson/repo/logkafka.git/_build/src/librdkafka/src/project_librdkafka/src/rdkafka_broker.c:2106: undefined reference to crc32' /data/home/samson/repo/logkafka.git/_build/src/librdkafka/src/project_librdkafka/src/rdkafka_broker.c:2120: undefined reference to
crc32'
/data/home/samson/repo/logkafka.git/_build/src/librdkafka/src/project_librdkafka/src/rdkafka_broker.c:2134: undefined reference to crc32' /data/home/samson/repo/logkafka.git/_build/src/librdkafka/src/project_librdkafka/src/rdkafka_broker.c:2145: undefined reference to
crc32'
librdkafka/lib/librdkafka.a(rdkafka_broker.o):/data/home/samson/repo/logkafka.git/_build/src/librdkafka/src/project_librdkafka/src/rdkafka_broker.c:2340: more undefined references to crc32' follow librdkafka/lib/librdkafka.a(rdkafka_broker.o): In function
rd_kafka_broker_produce_toppar':
/data/home/samson/repo/logkafka.git/_build/src/librdkafka/src/project_librdkafka/src/rdkafka_broker.c:2193: undefined reference to deflateInit2_' /data/home/samson/repo/logkafka.git/_build/src/librdkafka/src/project_librdkafka/src/rdkafka_broker.c:2213: undefined reference to
deflateBound'
/data/home/samson/repo/logkafka.git/_build/src/librdkafka/src/project_librdkafka/src/rdkafka_broker.c:2235: undefined reference todeflate' /data/home/samson/repo/logkafka.git/_build/src/librdkafka/src/project_librdkafka/src/rdkafka_broker.c:2259: undefined reference to
deflate'
/data/home/samson/repo/logkafka.git/_build/src/librdkafka/src/project_librdkafka/src/rdkafka_broker.c:2271: undefined reference todeflateEnd' /data/home/samson/repo/logkafka.git/_build/src/librdkafka/src/project_librdkafka/src/rdkafka_broker.c:2249: undefined reference to
deflateEnd'
/data/home/samson/repo/logkafka.git/_build/src/librdkafka/src/project_librdkafka/src/rdkafka_broker.c:2279: undefined reference todeflateEnd' librdkafka/lib/librdkafka.a(rdgz.o): In function
rd_gz_decompress':
/data/home/samson/repo/logkafka.git/_build/src/librdkafka/src/project_librdkafka/src/rdgz.c:59: undefined reference toinflateInit2_' /data/home/samson/repo/logkafka.git/_build/src/librdkafka/src/project_librdkafka/src/rdgz.c:65: undefined reference to
inflateGetHeader'
/data/home/samson/repo/logkafka.git/_build/src/librdkafka/src/project_librdkafka/src/rdgz.c:84: undefined reference toinflate' /data/home/samson/repo/logkafka.git/_build/src/librdkafka/src/project_librdkafka/src/rdgz.c:115: undefined reference to
inflateEnd'
/data/home/samson/repo/logkafka.git/_build/src/librdkafka/src/project_librdkafka/src/rdgz.c:90: undefined reference toinflateEnd' /data/home/samson/repo/logkafka.git/_build/src/librdkafka/src/project_librdkafka/src/rdgz.c:115: undefined reference to
inflateEnd'
/data/home/samson/repo/logkafka.git/_build/src/librdkafka/src/project_librdkafka/src/rdgz.c:106: undefined reference to`inflateEnd'
collect2: error: ld returned 1 exit status
collect2: error: ld returned 1 exit status
make[2]: *** [bin/logkafka] Error 1
make[1]: *** [src/CMakeFiles/logkafka.dir/all] Error 2
make: *** [all] Error 2
It looks like missing the zlib library. Can you show me the CMake command.
cmake -H. -B_build -DCMAKE_INSTALL_PREFIX=_install -DINSTALL_LIBRDKAFKA=ON -DINSTALL_LIBZOOKEEPER_MT=ON -DINSTALL_LIBUV=ON -DINSTALL_LIBPCRE2=ON
Try this method
Install librdkafka(>0.8.6), libzookeeper_mt, libuv(>v1.6.0), libpcre2(>10.20) manually, then
cmake -H. -B_build -DCMAKE_INSTALL_PREFIX=_install
cd _build
make -j4
make install
@samson-wang Is it ok now?
Perfect!
Thanks!
Sorry for late response.