Open Anaphory opened 2 years ago
Hey, thanks a lot for submitting this issue and I am very grateful for the kind words! I am unsure as to why you encountered the issue and will try to replicate it myself to figure out a solution. It might be an oversight on my side and you might need to use conan_target_link_libraries(${PROJECT_NAME})
.
I am probably doing something wrong, because I'm very new to C++ and wanted to start from a sensible template. (This template is awesome, by the way! It got me started very well, and I am much happier with the state of my learning project than I could imagine if I started from scratch. I just like myself a good build/package structure.)
Describe the bug
Following the instructions, I had a Conan provided library not linked, so I got
undefined reference to boost::read_graphml(std::istream&, boost::mutate_graph&, unsigned long)'
fromld
.To Reproduce Steps to reproduce the behavior:
I am trying to play around with graphs, so I included Conan in the cmake configuration
and changed the
Conan.cmake
to include boostI set the project to compile executables and wrote a small
main.cpp
to load a graph from a GraphML file:boom:
Expected behavior
I thought with this setup, Conan would pull in Boost to a known location, and cmake would ensure it gets linked to. (I had some version of Boost headers available before installing Boost using Conan, so that may have complicated the impression I got.)
Workaround
I added
conan_target_link_libraries(${PROJECT_NAME})
as last line to myCMakeList.txt
and it works fine. So I assume the issue is more how I use the template and associated software – which, fair, I don't really understand well enough – and not an actual issue with the template, but maybe it is an issue worth pointing out?Environment
I'm happy to provide version strings and other similar items, I just don't know what is useful.