Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/138.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 字段';缓冲区';具有不完整类型';boost::阵列<;char,4096ul>';_C++_C++11_Boost_Boost Asio - Fatal编程技术网

C++ 字段';缓冲区';具有不完整类型';boost::阵列<;char,4096ul>';

C++ 字段';缓冲区';具有不完整类型';boost::阵列<;char,4096ul>';,c++,c++11,boost,boost-asio,C++,C++11,Boost,Boost Asio,我正试图从中编译一个简单的RESTAPI示例 但是当我运行makeall或justmake时,我会得到以下错误 [ 55%] Building CXX object examples/CMakeFiles/example_with_all.dir/example_with_all.cpp.o In file included from /home/hinach4n/Project-Alpha/libs/crow/examples/example_with_all.cpp:1:0: /home

我正试图从中编译一个简单的RESTAPI示例

但是当我运行makeall或justmake时,我会得到以下错误

[ 55%] Building CXX object 

examples/CMakeFiles/example_with_all.dir/example_with_all.cpp.o
In file included from /home/hinach4n/Project-Alpha/libs/crow/examples/example_with_all.cpp:1:0:
/home/hinach4n/Project-Alpha/libs/crow/examples/../amalgamate/crow_all.h:5026:42: error: field ‘buffer_’ has incomplete type ‘boost::array<char, 4096ul>’
                 boost::array<char, 4096> buffer_;
                                          ^
In file included from /usr/include/boost/asio/buffer.hpp:23:0,
                 from /usr/include/boost/asio/detail/reactive_socket_service.hpp:22,
                 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/hinach4n/Project-Alpha/libs/crow/examples/../amalgamate/crow_all.h:242,
                 from /home/hinach4n/Project-Alpha/libs/crow/examples/example_with_all.cpp:1:
/usr/include/boost/asio/detail/array_fwd.hpp:23:7: note: declaration of ‘class boost::array<char, 4096ul>’
 class array;
       ^
examples/CMakeFiles/example_with_all.dir/build.make:62: recipe for target 'examples/CMakeFiles/example_with_all.dir/example_with_all.cpp.o' failed
make[2]: *** [examples/CMakeFiles/example_with_all.dir/example_with_all.cpp.o] Error 1
CMakeFiles/Makefile2:321: recipe for target 'examples/CMakeFiles/example_with_all.dir/all' failed
make[1]: *** [examples/CMakeFiles/example_with_all.dir/all] Error 2
Makefile:94: recipe for target 'all' failed
make: *** [all] Error 2
[55%]构建CXX对象
examples/cmakfiles/example_with_all.dir/example_with_all.cpp.o
包含在/home/hinach4n/Project Alpha/libs/crow/examples/example_with_all.cpp:1:0:
/home/hinach4n/Project Alpha/libs/crow/examples/。/mergage/crow_all.h:5026:42:错误:字段“buffer_”的类型“boost::array”不完整
阵列缓冲区;
^
在/usr/include/boost/asio/buffer.hpp:23:0中包含的文件中,
来自/usr/include/boost/asio/detail/reactive\u socket\u service.hpp:22,
从/usr/include/boost/asio/datagram\u socket\u service.hpp:30,
从/usr/include/boost/asio/basic_datagram_socket.hpp:21,
从/usr/include/boost/asio.hpp:21,
from/home/hinach4n/Project Alpha/libs/crow/examples/。/mergage/crow_all.h:242,
from/home/hinach4n/Project Alpha/libs/crow/examples/example_with_all.cpp:1:
/usr/include/boost/asio/detail/array_fwd.hpp:23:7:注意:“类boost::array”的声明
类数组;
^
examples/CMakeFiles/example_with_all.dir/build.make:62:target'examples/CMakeFiles/example_with_all.dir/example_with_all.cpp.o'失败
生成[2]:***[examples/CMakeFiles/example_with_all.dir/example_with_all.cpp.o]错误1
CMakeFiles/Makefile2:321:目标“示例/CMakeFiles/example_with_all.dir/all”的配方失败
make[1]:***[examples/CMakeFiles/example_with_all.dir/all]错误2
Makefile:94:目标“全部”的配方失败
make:**[全部]错误2

我查看了头文件,似乎无法理解问题所在!谢谢你的帮助

此错误消息表示未包含定义为
boost::array
的头文件


可能的修复方法:将
#include
添加到
crowu all.h

的顶部,它在我的pc上运行良好(boost 1.60、gcc 6.2.1、cmake 3.6.2)。mhm im使用boost 1.58,example_with_all.cpp是唯一不想合作的文件。其他文件编译并运行