Skip to content

Build error when -DBUILD_EXAMPLES=False #314

@Yadunund

Description

@Yadunund

Greetings,

I tried building the latest master with -DBUILD_EXAMPLES=False and I encounter the error below

/usr/bin/ld: cannot find -lbt_sample_nodes
collect2: error: ld returned 1 exit status
make[2]: *** [tests/CMakeFiles/behaviortree_cpp_v3_test.dir/build.make:284: tests/behaviortree_cpp_v3_test] Error 1
make[1]: *** [CMakeFiles/Makefile2:227: tests/CMakeFiles/behaviortree_cpp_v3_test.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

This happens since lib bt_samples_nodes is only built when BUILD_EXAMPLES is enabled but is linked to the tests which gets built regardless

Instructions to reproduce error:

git clone https://github.com/BehaviorTree/BehaviorTree.CPP.git
cd BehaviorTree.CPP
mkdir build && cd build
cmake .. -DBUILD_EXAMPLES=False
make

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions