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

Linker Errors using C++17 #200

Closed
SegfaultCreator opened this issue May 29, 2020 · 5 comments
Closed

Linker Errors using C++17 #200

SegfaultCreator opened this issue May 29, 2020 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@SegfaultCreator
Copy link

Hello together,
while trying to do all the provided tutorials, i ran into a linking issue when defining Nodes that use Input and Output ports. During build process, the following issues are raised when i add the Code to register the Nodes:

/usr/local/include/behaviortree_cpp_v3/basic_types.h:267: error: undefined reference to `BT::PortInfo::setDescription(std::basic_string_view<char, std::char_traits >)'

/usr/local/include/behaviortree_cpp_v3/basic_types.h:115: error: undefined reference to `std::__cxx11::basic_string<char, std::char_traits, std::allocator > BT::convertFromString<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >(std::basic_string_view<char, std::char_traits >)'

... (6 in total)

During debugging i moved the files outside our main CMake-project and the build was successful.
It turned out, that the issue can be triggered by adding
set(CMAKE_CXX_STANDARD 17) in the CMake File.

I know that the ReadMe file sets the CMake to C++14, however i would really like to use the tree in my C++17 project. Is there any way to fix this issue in C++17 or are there any Releases in sight compatible with C++17?

Thanks in Advance

@facontidavide facontidavide self-assigned this May 29, 2020
@facontidavide facontidavide added the bug Something isn't working label May 29, 2020
@facontidavide
Copy link
Collaborator

Compliment for being issue number 200.

As a special gift, you get a prompt solution to your issue (just pushed)

@SegfaultCreator
Copy link
Author

Thanks for the impressively quick Answer 👍
A Colleague suggested compiling the Lib with C++17, which also works now.
Keep up the good work!

@facontidavide
Copy link
Collaborator

yes, the problem was that you could not mix c++14 and c++17 together. Now you can

@SegfaultCreator
Copy link
Author

Supplemental info for my suggestion to use C++17 (for anyone googling this stuff):
Compiling BehaviorTree with C++17 will produce issues when using Groot (uses C++11)

@facontidavide
Copy link
Collaborator

not with the latest changes... Grood submodule to be updated accordingly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants