You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)' from ld.
To Reproduce
Steps to reproduce the behavior:
I am trying to play around with graphs, so I included Conan in the cmake configuration
option(${PROJECT_NAME}_ENABLE_CONAN "Enable the Conan package manager for this project." ON)
/usr/bin/ld: CMakeFiles/CMCMC.dir/src/main.cpp.o: in function `void boost::read_graphml<boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::no_property, boost::no_property, boost::no_property, boost::listS> >(std::istream&, boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::no_property, boost::no_property, boost::no_property, boost::listS>&, boost::dynamic_properties&, unsigned long)':
/home/anaphory/.conan/data/boost/1.79.0/_/_/package/1671931156455a119d7c3f14d951ac5fdbc5cd10/include/boost/graph/graphml.hpp:229: undefined reference to `boost::read_graphml(std::istream&, boost::mutate_graph&, unsigned long)'
collect2: error: ld returned 1 exit status
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 my CMakeList.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.
The text was updated successfully, but these errors were encountered:
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💥
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.
The text was updated successfully, but these errors were encountered: