You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@zookeeper.apache.org by "Rajkiran Sura (Jira)" <ji...@apache.org> on 2019/10/11 15:03:00 UTC

[jira] [Commented] (ZOOKEEPER-2108) Compilation error in ZkAdaptor.cc with GCC 4.7 or later

    [ https://issues.apache.org/jira/browse/ZOOKEEPER-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16949529#comment-16949529 ] 

Rajkiran Sura commented on ZOOKEEPER-2108:
------------------------------------------

Yes, this still does exist in 3.5.5 branch too. Also, apart from that I am encountering additional issue as below:

 

I have used multiple versions of GCC and the issue exists in both the cases (gcc-4.8.5 and gcc-7.3.1).

I have followed the instructions given in README.txt. Also, due to restructuring in 3.5.5, I had to update ZOOKEEPER_PATH in configure.ac as below:
{code:java}
# Zookeeper C client
ZOOKEEPER_PATH=${BUILD_PATH}/../../zookeeper-client/zookeeper-client-c
{code}
I am encountering these errors during "make" phase:
{code:java}
$ make
make all-recursive
make[1]: Entering directory '/tmp/bar2/zookeeper-3.5.5-SNAPSHOT/zookeeper-contrib/zookeeper-contrib-zktreeutil'
Making all in src
make[2]: Entering directory '/tmp/bar2/zookeeper-3.5.5-SNAPSHOT/zookeeper-contrib/zookeeper-contrib-zktreeutil/src'
g++ -DHAVE_CONFIG_H -I. -I.. -I/tmp/bar2/zookeeper-3.5.5-SNAPSHOT/zookeeper-contrib/zookeeper-contrib-zktreeutil/../../zookeeper-client/zookeeper-client-c/include -I/tmp/bar2/zookeeper-3.5.5-SNAPSHOT/zookeeper-contrib/zookeeper-contri
b-zktreeutil/../../zookeeper-client/zookeeper-client-c/generated -I../include -I/usr/local/include -I/usr/include -I/usr/include/libxml2 -g -O2 -MT ZkAdaptor.o -MD -MP -MF .deps/ZkAdaptor.Tpo -c -o ZkAdaptor.o ZkAdaptor.cc
ZkAdaptor.cc: In member function ‘bool zktreeutil::ZooKeeperAdapter::createNode(const string&, const string&, int, bool)’:
ZkAdaptor.cc:276:18: error: ‘zoo_create’ was not declared in this scope
 rc = zoo_create( mp_zkHandle,
 ^~~~~~~~~~
ZkAdaptor.cc:276:18: note: suggested alternative: ‘zoo_create’
 rc = zoo_create( mp_zkHandle,
 ^~~~~~~~~~
 zoo_create
ZkAdaptor.cc: At global scope:
ZkAdaptor.cc:334:26: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
 int version) throw(ZooKeeperException)
 ^~~~~
ZkAdaptor.cc: In member function ‘bool zktreeutil::ZooKeeperAdapter::deleteNode(const string&, bool, int)’:
ZkAdaptor.cc:344:18: error: ‘zoo_delete’ was not declared in this scope
 rc = zoo_delete( mp_zkHandle, path.c_str(), version );
 ^~~~~~~~~~
ZkAdaptor.cc:344:18: note: suggested alternative: ‘zoo_delete’
 rc = zoo_delete( mp_zkHandle, path.c_str(), version );
 ^~~~~~~~~~
 zoo_delete
ZkAdaptor.cc: At global scope:
ZkAdaptor.cc:383:77: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
 vector< string > ZooKeeperAdapter::getNodeChildren (const string &path) throw (ZooKeeperException)
 ^~~~~
ZkAdaptor.cc: In member function ‘std::vector<std::basic_string<char> > zktreeutil::ZooKeeperAdapter::getNodeChildren(const string&)’:
ZkAdaptor.cc:395:18: error: ‘zoo_get_children’ was not declared in this scope
 rc = zoo_get_children( mp_zkHandle,
 ^~~~~~~~~~~~~~~~
ZkAdaptor.cc:395:18: note: suggested alternative: ‘zoo_get_children’
 rc = zoo_get_children( mp_zkHandle,
 ^~~~~~~~~~~~~~~~
 zoo_get_children
{code}
Its weird because, "zookeeper.h" is accessible and these are still defined in there.

Am I missing something here? Thanks!

> 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
>
> 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.3.4#803005)