Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open include file: 'asio.hpp': No such file or directory #226

Open
ToyinIku opened this issue Jun 23, 2022 · 3 comments
Open

Cannot open include file: 'asio.hpp': No such file or directory #226

ToyinIku opened this issue Jun 23, 2022 · 3 comments

Comments

@ToyinIku
Copy link

ToyinIku commented Jun 23, 2022

After running cmake --build build --config Release --target ovpncli I get the error below. Is there another system variable that needs to be defined or something else I need to download?

C:\Users\toyiniku\Documents\core\cmake\..\openvpn/io/io.hpp(28,10): fatal error C1083: Cannot open include file: 'asio.hpp': No such file or directory [C:\Users\toyiniku\Documents\core\build\test\ovpncli\ovpncli.vcxproj]

@ToyinIku
Copy link
Author

This is on Windows 10

@OPstriker
Copy link

Did you install asio using vcpkg?

@DavidLee528
Copy link

When I compile on Ubuntu 20.04 with 'boost', i encountered:

david@ThinkpadT480s:~/tmp/openvpn3/build$ l
CMakeCache.txt  CMakeFiles/  Makefile  bin/  client/  cmake_install.cmake  lib/  test/
david@ThinkpadT480s:~/tmp/openvpn3/build$ make -j8
[  3%] Building C object test/ovpncli/CMakeFiles/xkey.dir/__/__/openvpn/openssl/xkey/xkey_helper.c.o
[  3%] Building CXX object test/unittests/googletest-build/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
[  6%] Building CXX object test/ssl/CMakeFiles/proto.dir/proto.cpp.o
[  6%] Building C object test/ovpncli/CMakeFiles/xkey.dir/__/__/openvpn/openssl/xkey/xkey_provider.c.o
[  8%] Linking C static library libxkey.a
[  8%] Built target xkey
[  9%] Building CXX object test/ovpncli/CMakeFiles/ovpncli.dir/cli.cpp.o
In file included from /home/david/tmp/openvpn3/cmake/../openvpn/buffer/buffer.hpp:59,
                 from /home/david/tmp/openvpn3/cmake/../openvpn/common/unicode.hpp:36,
                 from /home/david/tmp/openvpn3/cmake/../openvpn/common/file.hpp:33,
                 from /home/david/tmp/openvpn3/test/ssl/proto.cpp:183:
/home/david/tmp/openvpn3/cmake/../openvpn/io/io.hpp:28:10: fatal error: asio.hpp: No such file or directory
   28 | #include <asio.hpp>
      |          ^~~~~~~~~~
compilation terminated.
make[2]: *** [test/ssl/CMakeFiles/proto.dir/build.make:76: test/ssl/CMakeFiles/proto.dir/proto.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:390: test/ssl/CMakeFiles/proto.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
In file included from /home/david/tmp/openvpn3/cmake/../client/ovpncli.cpp:30,
                 from /home/david/tmp/openvpn3/test/ovpncli/cli.cpp:63:
/home/david/tmp/openvpn3/cmake/../openvpn/io/io.hpp:28:10: fatal error: asio.hpp: No such file or directory
   28 | #include <asio.hpp>
      |          ^~~~~~~~~~
compilation terminated.
make[2]: *** [test/ovpncli/CMakeFiles/ovpncli.dir/build.make:76: test/ovpncli/CMakeFiles/ovpncli.dir/cli.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:364: test/ovpncli/CMakeFiles/ovpncli.dir/all] Error 2
[ 11%] Linking CXX static library ../../../../lib/libgtest.a
[ 11%] Built target gtest
make: *** [Makefile:136: all] Error 2

And i changed all #include <asio.hpp> to #include <boost/asio.hpp> by using commands below:

david@ThinkpadT480s:~/tmp/openvpn3$ find . -type f -name "*" | xargs grep "#include <asio.hpp>"
./openvpn/io/io.hpp:#include <asio.hpp>
./test/unittests/core_tests.cpp:#include <asio.hpp>
./test/unused:#include <asio.hpp>
david@ThinkpadT480s:~/tmp/openvpn3$ vim ./openvpn/io/io.hpp
david@ThinkpadT480s:~/tmp/openvpn3$ vim ./test/unittests/core_tests.cpp
david@ThinkpadT480s:~/tmp/openvpn3$ vim ./test/unused

The problem solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants