[ https://issues.apache.org/jira/browse/ZOOKEEPER-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated ZOOKEEPER-2108: -------------------------------------- Labels: pull-request-available (was: ) > Compilation error in ZkAdaptor.cc with GCC 4.7 or later > ------------------------------------------------------- > > Key: ZOOKEEPER-2108 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2108 > Project: ZooKeeper > Issue Type: Bug > Affects Versions: 3.4.6 > Reporter: Emmanuel Bourg > Priority: Minor > Labels: pull-request-available > Time Spent: 10m > Remaining Estimate: 0h > > Hi, > Debian and Fedora have a patch fixing a compilation failure in ZkAdaptor.cc > but it doesn't appear to be fixed in the upcoming version 3.5.0. This issue > is similar to ZOOKEEPER-470 and ZOOKEEPER-1795. > The error is : > {code} > g++ -DHAVE_CONFIG_H -I. -I.. -D_FORTIFY_SOURCE=2 > -I/home/ebourg/packaging/zookeeper/src/contrib/zktreeutil/../../c/include > -I/home/ebourg/packaging/zookeeper/src/contrib/zktreeutil/../../c/generated > -I../include -I/usr/local/include -I/usr/include -I/usr/include/libxml2 -g > -O2 -fstack-protector-strong -Wformat -Werror=format-security -MT ZkAdaptor.o > -MD -MP -MF .deps/ZkAdaptor.Tpo -c -o ZkAdaptor.o ZkAdaptor.cc > ZkAdaptor.cc: In member function ‘void > zktreeutil::ZooKeeperAdapter::reconnect()’: > ZkAdaptor.cc:220:21: error: ‘sleep’ was not declared in this scope > sleep (1); > {code} > This is fixed by including unistd.h in ZkAdaptor.cc or ZkAdaptor.h > The Debian patch: > https://sources.debian.net/src/zookeeper/3.4.5%2Bdfsg-2/debian/patches/ftbfs-gcc-4.7.diff/ > and the Fedora patch: > http://pkgs.fedoraproject.org/cgit/zookeeper.git/tree/zookeeper-3.4.5-zktreeutil-gcc.patch -- This message was sent by Atlassian Jira (v8.20.7#820007)