拿到asio(non-boost)的源码后我按照网上查到的资料安装了一下
./configuer --prefix=/home/asiotest/ --without-boost
make
make install
在asiotest目录下得到了include文件夹,之后在asiotest目录下创建了一个test.cpp想简单测试一下,test.cpp中只简单的#include了include文件夹下的asio.hpp头文件,然后编译:
g++ -std=c++11 -DASIO_STANDALONE -pthread -o main test.cpp
然后编译器报了这个错误
In file included from /usr/src/asio-1.10.8/include/asio.hpp:18:0,
from asio_bind.cpp:2:
/usr/src/asio-1.10.8/include/asio/async_result.hpp:18:34: fatal error: asio/detail/config.hpp: No such file or directory
compilation terminated.
提示找不到asio/detail/config.hpp,但是文件确实在哪个文件夹里
网上说asio只要简单的包含头文件就可以使用,想请教大佬们是我在配置或者编译时哪里弄错了么?
想接触一下这个库 不知道该怎么开始