ubuntu@localhost:~/libkafka-asio$ make
[ 3%] Building CXX object examples/CMakeFiles/fetch_cxx03.dir/fetch_cxx03.cpp.o
Linking CXX executable fetch_cxx03
[ 3%] Built target fetch_cxx03
[ 6%] Building CXX object examples/CMakeFiles/fetch_cxx11.dir/fetch_cxx11.cpp.o
/home/ubuntu/libkafka-asio/examples/fetch_cxx11.cpp: In function ‘int main(int, char**)’:
/home/ubuntu/libkafka-asio/examples/fetch_cxx11.cpp:43:8: error: ‘BytesToString’ does not name a type
auto BytesToString = [](const libkafka_asio::Bytes& bytes) -> std::string
^
/home/ubuntu/libkafka-asio/examples/fetch_cxx11.cpp: In lambda function:
/home/ubuntu/libkafka-asio/examples/fetch_cxx11.cpp:73:49: error: ‘BytesToString’ was not declared in this scope
std::cout << BytesToString(message.value()) << std::endl;
^
/home/ubuntu/libkafka-asio/examples/fetch_cxx11.cpp: In lambda function:
/home/ubuntu/libkafka-asio/examples/fetch_cxx11.cpp:74:5: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
});
^
/home/ubuntu/libkafka-asio/examples/fetch_cxx11.cpp:74:6: error: no matching function for call to ‘for_each(libkafka_asio::FetchResponse::const_iterator, libkafka_asio::FetchResponse::const_ite
rator, main(int, char**)::<lambda(const ErrorCodeType&, const OptionalType&)>::<lambda(const libkafka_asio::MessageAndOffset&)>)’
});
^
/home/ubuntu/libkafka-asio/examples/fetch_cxx11.cpp:74:6: note: candidate is:
In file included from /usr/include/c++/4.9/algorithm:62:0,
from /usr/include/boost/smart_ptr/shared_ptr.hpp:42,
from /usr/include/boost/shared_ptr.hpp:17,
from /usr/include/boost/asio/detail/shared_ptr.hpp:23,
from /usr/include/boost/asio/detail/socket_ops.hpp:21,
from /usr/include/boost/asio/detail/socket_holder.hpp:20,
from /usr/include/boost/asio/detail/reactive_socket_accept_op.hpp:24,
from /usr/include/boost/asio/detail/reactive_socket_service.hpp:30,
from /usr/include/boost/asio/datagram_socket_service.hpp:30,
from /usr/include/boost/asio/basic_datagram_socket.hpp:21,
from /usr/include/boost/asio.hpp:21,
from /home/ubuntu/libkafka-asio/examples/fetch_cxx11.cpp:18:
/usr/include/c++/4.9/bits/stl_algo.h:3750:5: note: template<class _IIter, class _Funct> _Funct std::for_each(_IIter, _IIter, _Funct)
for_each(_InputIterator __first, _InputIterator __last, _Function __f)
^
/usr/include/c++/4.9/bits/stl_algo.h:3750:5: note: template argument deduction/substitution failed:
/home/ubuntu/libkafka-asio/examples/fetch_cxx11.cpp: In substitution of ‘template<class _IIter, class _Funct> _Funct std::for_each(_IIter, _IIter, _Funct) [with _IIter = libkafka_asio::detail::
FetchResponseIterator<std::map<std::basic_string<char>, libkafka_asio::detail::TopicPartitionMap<libkafka_asio::FetchResponse::TopicPartitionProperties>, std::less<std::basic_string<char> >, st
d::allocator<std::pair<const std::basic_string<char>, libkafka_asio::detail::TopicPartitionMap<libkafka_asio::FetchResponse::TopicPartitionProperties> > > > >; _Funct = main(int, char**)::<lamb
da(const ErrorCodeType&, const OptionalType&)>::<lambda(const libkafka_asio::MessageAndOffset&)>]’:
/home/ubuntu/libkafka-asio/examples/fetch_cxx11.cpp:74:6: required from here
/home/ubuntu/libkafka-asio/examples/fetch_cxx11.cpp:74:6: error: template argument for ‘template<class _IIter, class _Funct> _Funct std::for_each(_IIter, _IIter, _Funct)’ uses local type ‘main(
int, char**)::<lambda(const ErrorCodeType&, const OptionalType&)>::<lambda(const libkafka_asio::MessageAndOffset&)>’
});
^
/home/ubuntu/libkafka-asio/examples/fetch_cxx11.cpp:74:6: error: trying to instantiate ‘template<class _IIter, class _Funct> _Funct std::for_each(_IIter, _IIter, _Funct)’
/home/ubuntu/libkafka-asio/examples/fetch_cxx11.cpp: In function ‘int main(int, char**)’:
/home/ubuntu/libkafka-asio/examples/fetch_cxx11.cpp:75:3: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
});
^
/home/ubuntu/libkafka-asio/examples/fetch_cxx11.cpp:75:4: error: no matching function for call to ‘libkafka_asio::detail::BasicConnection<libkafka_asio::detail::BasicConnectionService<libkafka_
asio::detail::ConnectionServiceImpl> >::AsyncRequest(libkafka_asio::FetchRequest&, main(int, char**)::<lambda(const ErrorCodeType&, const OptionalType&)>)’
});
^
/home/ubuntu/libkafka-asio/examples/fetch_cxx11.cpp:75:4: note: candidate is:
In file included from /home/ubuntu/libkafka-asio/examples/../lib/libkafka_asio/connection.h:13:0,
from /home/ubuntu/libkafka-asio/examples/../lib/libkafka_asio/libkafka_asio.h:17,
from /home/ubuntu/libkafka-asio/examples/fetch_cxx11.cpp:19:
/home/ubuntu/libkafka-asio/examples/../lib/libkafka_asio/detail/basic_connection.h:146:8: note: void libkafka_asio::detail::BasicConnection<Service>::AsyncRequest(const TRequest&, const typename libkafka_asio::detail::BasicConnection<Service>::Handler<TRequest>::Type&) [with TRequest = libkafka_asio::FetchRequest; Service = libkafka_asio::detail::BasicConnectionService<libkafka_asio::detail::ConnectionServiceImpl>; typename libkafka_asio::detail::BasicConnection<Service>::Handler<TRequest>::Type = boost::function<void(const boost::system::error_code&, const boost::optional<libkafka_asio::FetchResponse>&)>]
void AsyncRequest(const TRequest& request,
^
/home/ubuntu/libkafka-asio/examples/../lib/libkafka_asio/detail/basic_connection.h:146:8: note: no known conversion for argument 2 from ‘main(int, char**)::<lambda(const ErrorCodeType&, const OptionalType&)>’ to ‘const Type& {aka const boost::function<void(const boost::system::error_code&, const boost::optional<libkafka_asio::FetchResponse>&)>&}’
examples/CMakeFiles/fetch_cxx11.dir/build.make:54: recipe for target 'examples/CMakeFiles/fetch_cxx11.dir/fetch_cxx11.cpp.o' failed
make[2]: *** [examples/CMakeFiles/fetch_cxx11.dir/fetch_cxx11.cpp.o] Error 1
CMakeFiles/Makefile2:128: recipe for target 'examples/CMakeFiles/fetch_cxx11.dir/all' failed
make[1]: *** [examples/CMakeFiles/fetch_cxx11.dir/all] Error 2
Makefile:86: recipe for target 'all' failed
make: *** [all] Error 2
ubuntu@localhost:~/libkafka-asio$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.9/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.9.2-10ubuntu13' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.9.2 (Ubuntu 4.9.2-10ubuntu13)
ubuntu@localhost:~/libkafka-asio$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 15.04
Release: 15.04
Codename: vivid