dinghram opened a new issue #13927:
URL: https://github.com/apache/pulsar/issues/13927


   **Describe the bug**
   When compiling pulsar-client-cpp in pulsar 2.8.2, there is an ambiguous call 
to subscribe in ConsumerTest.cc.
   
   **To Reproduce**
   Steps to reproduce the behavior:
   1. Compile pulsar-client-cpp
   
   **Expected behavior**
   CPP client compiles
   
   **Desktop (please complete the following information):**
    - CentOS 7
   
   **Additional context**
   -- The C compiler identification is GNU 4.8.5
   -- The CXX compiler identification is GNU 4.8.5
   -- Check for working C compiler: /usr/bin/cc
   -- Check for working C compiler: /usr/bin/cc -- works
   -- Detecting C compiler ABI info
   -- Detecting C compiler ABI info - done
   -- Detecting C compile features
   -- Detecting C compile features - done
   -- Check for working CXX compiler: /usr/bin/c++
   -- Check for working CXX compiler: /usr/bin/c++ -- works
   -- Detecting CXX compiler ABI info
   -- Detecting CXX compiler ABI info - done
   -- Detecting CXX compile features
   -- Detecting CXX compile features - done
   -- ARCHITECTURE: x86_64
   -- BUILD_DYNAMIC_LIB:  ON
   -- BUILD_STATIC_LIB:  ON
   -- BUILD_TESTS:  ON
   -- BUILD_PYTHON_WRAPPER:  ON
   -- BUILD_PERF_TOOLS:  OFF
   -- LINK_STATIC:  OFF
   -- USE_LOG4CXX:  OFF
   -- CMAKE_BUILD_TYPE:  RelWithDebInfo
   -- Looking for pthread.h
   -- Looking for pthread.h - found
   -- Looking for pthread_create
   -- Looking for pthread_create - not found
   -- Check if compiler accepts -pthread
   -- Check if compiler accepts -pthread - yes
   -- Found Threads: TRUE  
   -- Threads library: -pthread
   -- Found OpenSSL: /usr/lib64/libcrypto.so (found version "1.0.2t")  
   -- Found ZLIB: /usr/local/lib/libz.so (found version "1.2.11") 
   Failed to find Protobuf in config mode, try to find it from system path
   -- Protobuf_LITE_LIBRARIES: /usr/local/lib/libprotobuf-lite.so
   -- Protobuf_INCLUDE_DIRS: /usr/local/include
   -- Found CURL: /usr/local/lib/libcurl.so (found version "7.61.0") 
   -- Boost version: 1.68.0
   -- Linking with Boost:System
   -- Using Boost::Regex
   -- Boost version: 1.68.0
   -- Found the following Boost libraries:
   --   system
   --   regex
   -- Found PythonLibs: /usr/lib64/libpython2.7.so (found version "2.7.5") 
   -- PYTHON: 2.7.5
   -- Boost version: 1.68.0
   -- Found the following Boost libraries:
   --   python27
   -- HAS_ZSTD: 1
   -- HAS_SNAPPY: 1
   -- Using Boost Python libs: /usr/local/lib/libboost_python27.a
   
   
   Error:
   In file included from /usr/local/include/gtest/gtest.h:375:0,
                    from 
/usr/local/src/apache-pulsar-microfocus/pulsar-client-cpp/tests/ConsumerTest.cc:26:
   
/usr/local/src/apache-pulsar-microfocus/pulsar-client-cpp/tests/ConsumerTest.cc:
 In member function 'virtual void 
pulsar::ConsumerTest_testGetTopicNameFromReceivedMessage_Test::TestBody()':
   
/usr/local/src/apache-pulsar-microfocus/pulsar-client-cpp/tests/ConsumerTest.cc:448:78:
 error: call of overloaded 'subscribe(<brace-enclosed initializer list>, const 
char [6], pulsar::Consumer&)' is ambiguous
        ASSERT_EQ(ResultOk, client.subscribe({topic1, topic2}, "sub-2", 
consumer2));
                                                                                
 ^
   
/usr/local/src/apache-pulsar-microfocus/pulsar-client-cpp/tests/ConsumerTest.cc:448:78:
 note: candidates are:
   In file included from 
/usr/local/src/apache-pulsar-microfocus/pulsar-client-cpp/tests/ConsumerTest.cc:28:0:
   
/usr/local/src/apache-pulsar-microfocus/pulsar-client-cpp/include/pulsar/Client.h:119:12:
 note: pulsar::Result pulsar::Client::subscribe(const string&, const string&, 
pulsar::Consumer&)
        Result subscribe(const std::string& topic, const std::string& 
subscriptionName, Consumer& consumer);
               ^
   
/usr/local/src/apache-pulsar-microfocus/pulsar-client-cpp/include/pulsar/Client.h:164:12:
 note: pulsar::Result pulsar::Client::subscribe(const 
std::vector<std::basic_string<char> >&, const string&, pulsar::Consumer&)
        Result subscribe(const std::vector<std::string>& topics, const 
std::string& subscriptionName,
               ^
   
   
   
   A simple solution is to cast the initializer list as a 
std::vector<std::string> in the call to subscribe.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to