1

I am trying to use Botan library in my project. But I don't know how to do so.

Here is my project directory structure:

C:.
├───.vscode
├───botan
│   └───internal
└───lib
    ├───botan
    │   ├───.github
    │   │   ├───actions
    │   │   │   └───setup-build-agent
    │   │   └───workflows
    │   ├───build
    │   │   ├───docs
...

I am trying to link the botan library to my C++ project using g++. Here is what I have tried:

g++ main.cpp -o main.exe -Ilib/botan/build/include/botan -Llib/botan -lbotan-3

My main.cpp file looks like this:

#include<botan/aes.h>

I am getting the following error:

main.cpp:1:10: fatal error: botan/aes.h: No such file or directory
1 | #include \<botan/aes.h\>
|          ^\~\~\~\~\~\~\~\~\~\~\~\~
compilation terminated.

Note:

  • I have tried other header files under botan also.
  • I have built the botan library successfully.
  • 2
    `-Ilib/botan/build/include` Or skip all the manual nonsense and let cmake (maybe with Conan or vcpkg) take care of all of that for you. – sweenish Jul 19 '23 at 05:14
  • @sweenish I am trying to use cmake with vcpkg, doesn't work somehow. It is asking for findbotan.cmake file. – Syed Salman Jul 20 '23 at 06:07

0 Answers0