asio icon indicating copy to clipboard operation
asio copied to clipboard

Are there ASIO compile for QNX platform relevant document?

Open safrans opened this issue 3 years ago • 6 comments

I want to compile ASIO lib for QNX platform, but there are many errors in compilation. Are there ASIO compile for QNX platform relevant document?

safrans avatar Jan 06 '22 09:01 safrans

I am also curious about this. I cannot build asio in qnx 7.0 toolchain. Is the problem about me doing things wrong? Or does ASIO not support QNX 7.0 toolchain? thanks a lot

bseker avatar Sep 01 '22 09:09 bseker

What kind of API does qnx provide, what compiler is it using and what errors do you get?

klemens-morgenstern avatar Sep 01 '22 10:09 klemens-morgenstern

I am trying to compile the code in WSL2 by using VsCode. QNX provides a toolchain for linux hosts, which includes qcc & q++ compile commands for C & C++. As far as I can see, QNX SDP(software development platform) 7.0 provides its qcc&q++ which use GCC 5.4. At least this is how VsCode recognize them. When I build with GCC 9.4.0, there are no issues. However, When I tried to build with qcc&q++, I get several errors, some of them are as follows:


xxx/asio/include/asio/detail/handler_alloc_helpers.hpp:257:38: error: no matching function for call to 'std::__1::allocator_traits<asio::detail::recycling_allocator >::rebind_alloc<asio::detail::executor_op<asio::detail::binder0<std::__1::function<void()> >, std::__1::allocator, asio::detail::scheduler_operation> >::rebind_alloc(asio::detail::get_recycling_allocator<std::__1::allocator, asio::detail::thread_info_base::default_tag>::type)' Alloc, purpose>::get(a));
^ xxx/asio/include/asio/detail/handler_alloc_helpers.hpp:258:27: error: 'struct std::__1::allocator_traits<asio::detail::recycling_allocator >::rebind_alloc<asio::detail::executor_op<asio::detail::binder0<std::__1::function<void()> >, std::__1::allocator, asio::detail::scheduler_operation> >' has no member named 'allocate' return a1.allocate(1);
^ error: no matching function for call to 'std::__1::allocator_traits<asio::detail::recycling_allocator >::rebind_alloc<asio::detail::executor_op<asio::detail::binder0<std::__1::function<void()> >, std::__1::allocator, asio::detail::scheduler_operation> >::rebind_alloc(asio::detail::get_recycling_allocator<std::__1::allocator, asio::detail::thread_info_base::default_tag>::type)' Alloc, purpose>::get(*a));
^


I hope I can provide sound information concerning my problem. Thanks in advance

bseker avatar Sep 01 '22 12:09 bseker

it looks like that particular feature requires c++11. Are you setting the std to 11 with "-std=c++11"?

klemens-morgenstern avatar Sep 01 '22 12:09 klemens-morgenstern

actually trying to build with -std=c++17, but I think that this is also ok, right?

bseker avatar Sep 01 '22 14:09 bseker

I think I found my issue. looks like qcc comes with two different standard libs: GNU and LLVM.

When I add

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Y_gpp") to my cmake file, it sets to the GNU C++ library, and now it seems that all is well.

Thanks for your thoughts.

Note: I found the solution from : https://discourse.cmake.org/t/qnx-cmake-build/1309

bseker avatar Sep 02 '22 06:09 bseker