BehaviorTree.CPP icon indicating copy to clipboard operation
BehaviorTree.CPP copied to clipboard

Unable to build example https://github.com/BehaviorTree/btcpp_sample

Open MatteoAlbi opened this issue 2 years ago • 0 comments

I'm trying to build the basic example to "use BT.CPP in your application" : https://github.com/BehaviorTree/btcpp_sample My folder structure is the following:

BTcpp_test
    |- BehaviorTree.CPP
        |- ... preexisting files and directories
        |- build
    |- installdir
        |- bin
            |- bt3_log_cat
            |- bt3_plugin_manifest
        |- include/behaviortree_cpp/... all header files
            |- cmake/behaviortree_cpp
                |- behaviortree_cppConfig.cmake
                |- behaviortree_cppTargets-release.cmake
                |- behaviortree_cppTargets.cmake
            |- libbehaviortree_cpp.so
    |- test
        |- build
        |- CMakeLists.txt
        |- main.cpp
  • The folder BTcpp_test/BehaviorTree.CPP/build is used to build the library using conan using the commands provided in the README.md.
  • The folder BTcpp_test/installdir is where the package is then installed using the command cmake --install . --prefix "../../installdir" from inside the folder BTcpp_test/BehaviorTree.CPP/build.
  • BTcpp_test/test/build is used to build the example by running cmake -S . -B build; make -C build inside the folder BTcpp_test/test
  • BTcpp_test/test/CMakeLists.txt is copied-pasted from the example, and then I added list(APPEND CMAKE_PREFIX_PATH "/home/albi_mt/projects/BTcpp_test/installdir") to "include" the installation directory of the package.
  • BTcpp_test/test/main.cpp is copied-pasted from the example

When I try to configure the building of the example, no error rises. However, when I try to build it, a sequence of errors rise stating that all function calls result in undefined reference. It seems no source files are linked to the library. Am I missing some steps or there is a problem in the CMakeLists.txt?

P.S. I can't receive any confirmation email to activate an account on the forum https://discourse.behaviortree.dev/

MatteoAlbi avatar Apr 19 '23 15:04 MatteoAlbi