You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ 25%] Building CXX object CMakeFiles/pubs.dir/publisher.cpp.o
In file included from /usr/local/include/zenoh/api/bytes.hxx:18,
from /usr/local/include/zenoh/api.hxx:16,
from /usr/local/include/zenoh.hxx:15,
from /home/amin/code/zenoh/publisher.cpp:1:
/usr/local/include/zenoh/api/session.hxx: In member function‘void zenoh::Session::close(zenoh::Session::SessionCloseOptions&&, zenoh::ZResult*) &&’:
/usr/local/include/zenoh/api/session.hxx:890:9: error: cannot convert ‘z_moved_session_t*’ to ‘z_loaned_session_t*’
890 | __ZENOH_RESULT_CHECK(::z_close(interop::as_moved_c_ptr(*this), nullptr), err, "Failed to close the session");| ^~~~~~~~~~~~~~~~~~~~
||| z_moved_session_t*
In file included from /usr/local/include/zenoh.h:35,
from /usr/local/include/zenoh/zenohc.hxx:14,
from /usr/local/include/zenoh/api/base.hxx:21,
from /usr/local/include/zenoh/api/bytes.hxx:18,
from /usr/local/include/zenoh/api.hxx:16,
from /usr/local/include/zenoh.hxx:15,
from /home/amin/code/zenoh/publisher.cpp:1:
/usr/local/include/zenoh_commons.h:1724:47: note: initializing argument 1 of ‘z_result_t z_close(z_loaned_session_t*, const z_close_options_t*)’
1724 | z_result_t z_close(struct z_loaned_session_t *session,
|~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
In file included from /usr/local/include/zenoh/api/bytes.hxx:18,
from /usr/local/include/zenoh/api.hxx:16,
from /usr/local/include/zenoh.hxx:15,
from /home/amin/code/zenoh/publisher.cpp:1:
/usr/local/include/zenoh/api/session.hxx:890:9: error: cannot convert ‘z_moved_session_t*’ to ‘z_loaned_session_t*’
890 | __ZENOH_RESULT_CHECK(::z_close(interop::as_moved_c_ptr(*this), nullptr), err, "Failed to close the session");| ^~~~~~~~~~~~~~~~~~~~
||| z_moved_session_t*
In file included from /usr/local/include/zenoh.h:35,
from /usr/local/include/zenoh/zenohc.hxx:14,
from /usr/local/include/zenoh/api/base.hxx:21,
from /usr/local/include/zenoh/api/bytes.hxx:18,
from /usr/local/include/zenoh/api.hxx:16,
from /usr/local/include/zenoh.hxx:15,
from /home/amin/code/zenoh/publisher.cpp:1:
/usr/local/include/zenoh_commons.h:1724:47: note: initializing argument 1 of ‘z_result_t z_close(z_loaned_session_t*, const z_close_options_t*)’
1724 | z_result_t z_close(struct z_loaned_session_t *session,
|~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/home/amin/code/zenoh/publisher.cpp: In function‘int main(int, char**)’:
/home/amin/code/zenoh/publisher.cpp:8:55: error: ‘serialize’ is not a member of ‘zenoh::Bytes’
8 | session.put(KeyExpr("demo/example/simple"), Bytes::serialize("Simple!"));| ^~~~~~~~~
gmake[2]: *** [CMakeFiles/pubs.dir/build.make:76: CMakeFiles/pubs.dir/publisher.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:117: CMakeFiles/pubs.dir/all] Error 2
gmake: *** [Makefile:111: all] Error 2
I get the same error while trying to build the zenoh-cpp examples.
To reproduce
After i built zenoh-c and zenoh-cpp.
In test project with publisher.cpp and subscriber.cpp, I do:
mkdir -p build &&cd build
cmake ..
make
I get the error after running make.
CMakeLists.txt:
project(test-zenoh)
cmake_minimum_required(VERSION 3.16)
if(CMAKE_BUILD_TYPE STREQUAL"")
set(CMAKE_BUILD_TYPE Release)
endif()
find_package(zenohc REQUIRED)
find_package(zenohcxx REQUIRED)
# for both publisher and subscriberadd_executable(pubs publisher.cpp)
add_executable(subs subscriber.cpp)
target_link_libraries(pubs PUBLIC
zenohcxx::zenohc
)
target_link_libraries(subs PUBLIC
zenohcxx::zenohc
)
set_property(TARGET pubs PROPERTY LANGUAGE CXX)
set_property(TARGET pubs PROPERTY CXX_STANDARD 17)
set_property(TARGET subs PROPERTY LANGUAGE CXX)
set_property(TARGET subs PROPERTY CXX_STANDARD 17)
Describe the bug
Hello, I am new to Zenoh, I am trying to build a simple publisher/subscriber program (taken from docs: https://zenoh-cpp.readthedocs.io/en/latest/pubsub.html) for testing, when building i get this error:
I get the same error while trying to build the zenoh-cpp
examples
.To reproduce
After i built
zenoh-c
andzenoh-cpp
.In test project with publisher.cpp and subscriber.cpp, I do:
I get the error after running
make
.CMakeLists.txt:
System info
The text was updated successfully, but these errors were encountered: