<br><br><div class="gmail_quote">On Wed, Feb 1, 2012 at 4:27 AM, Michael Wild <span dir="ltr"><<a href="mailto:themiwi@gmail.com">themiwi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 02/01/2012 09:33 AM, Arnaud Gelas wrote:<br>
> Hi all,<br>
><br>
> I have been trying to compile a very simple example with cmake (2.8.5)<br>
> and boost, and I can't get what I am doing wrong...<br>
><br>
> CMakeLists.txt<br>
> ----------------------<br>
><br>
> cmake_minimum_required(VERSION 2.6)<br>
><br>
> project(ReadGraph)<br>
><br>
> find_package(Boost 1.46 COMPONENTS graph regex )<br>
><br>
> link_directories(${Boost_LIBRARY_DIRS})<br>
> include_directories(BEFORE ${Boost_INCLUDE_DIRS})<br>
><br>
> add_executable(ReadGraph ReadGraph.cpp)<br>
> target_link_libraries(ReadGraph ${Boost_LIBRARIES} )<br>
> # target_link_libraries(ReadGraph boost_graph boost_regex )<br>
><br>
><br>
> ReadGraph.cpp<br>
> ----------------------<br>
> // <a href="http://www.boost.org/doc/libs/1_37_0/libs/graph/doc/read_graphviz.html" target="_blank">http://www.boost.org/doc/libs/1_37_0/libs/graph/doc/read_graphviz.html</a><br>
> #include <iostream><br>
> #include <string><br>
> #include <fstream><br>
><br>
> #include <boost/graph/adjacency_list.hpp><br>
> #include <boost/graph/graphviz.hpp><br>
><br>
> int main(int , char* [])<br>
> {<br>
> return 0;<br>
> }<br>
><br>
> Here is what the error I get when trying to compile:<br>
><br>
> $ make<br>
> /usr/bin/cmake -H/home/ajg23/GITROOT/BGLCMakeQuestion<br>
> -B/home/ajg23/GITROOT/BGLCMakeQuestion/build --check-build-system<br>
> CMakeFiles/Makefile.cmake 0<br>
> /usr/bin/cmake -E cmake_progress_start<br>
> /home/ajg23/GITROOT/BGLCMakeQuestion/build/CMakeFiles<br>
> /home/ajg23/GITROOT/BGLCMakeQuestion/build/CMakeFiles/progress.marks<br>
> make -f CMakeFiles/Makefile2 all<br>
> make[1]: Entering directory `/home/ajg23/GITROOT/BGLCMakeQuestion/build'<br>
> make -f CMakeFiles/ReadGraph.dir/build.make CMakeFiles/ReadGraph.dir/depend<br>
> make[2]: Entering directory `/home/ajg23/GITROOT/BGLCMakeQuestion/build'<br>
> cd /home/ajg23/GITROOT/BGLCMakeQuestion/build && /usr/bin/cmake -E<br>
> cmake_depends "Unix Makefiles" /home/ajg23/GITROOT/BGLCMakeQuestion<br>
> /home/ajg23/GITROOT/BGLCMakeQuestion<br>
> /home/ajg23/GITROOT/BGLCMakeQuestion/build<br>
> /home/ajg23/GITROOT/BGLCMakeQuestion/build<br>
> /home/ajg23/GITROOT/BGLCMakeQuestion/build/CMakeFiles/ReadGraph.dir/DependInfo.cmake<br>
> --color=<br>
> make[2]: Leaving directory `/home/ajg23/GITROOT/BGLCMakeQuestion/build'<br>
> make -f CMakeFiles/ReadGraph.dir/build.make CMakeFiles/ReadGraph.dir/build<br>
> make[2]: Entering directory `/home/ajg23/GITROOT/BGLCMakeQuestion/build'<br>
> /usr/bin/cmake -E cmake_progress_report<br>
> /home/ajg23/GITROOT/BGLCMakeQuestion/build/CMakeFiles 1<br>
> [100%] Building CXX object CMakeFiles/ReadGraph.dir/ReadGraph.cpp.o<br>
> /usr/bin/c++ -o CMakeFiles/ReadGraph.dir/ReadGraph.cpp.o -c<br>
> /home/ajg23/GITROOT/BGLCMakeQuestion/ReadGraph.cpp<br>
> make[2]: *** No rule to make target `/usr/lib/libboost_graph-mt.so',<br>
> needed by `ReadGraph'. Stop.<br>
> make[2]: Leaving directory `/home/ajg23/GITROOT/BGLCMakeQuestion/build'<br>
> make[1]: *** [CMakeFiles/ReadGraph.dir/all] Error 2<br>
> make[1]: Leaving directory `/home/ajg23/GITROOT/BGLCMakeQuestion/build'<br>
> make: *** [all] Error 2<br>
><br>
><br>
> If I don't use ${Boost_LIBRARIES} but explicitly the corresponding<br>
> libraries (i.e. boost_graph and boost_regex) it compiles without any<br>
> problem...<br>
><br>
> Can anyone give me a hand on this one? Is this a bug?<br>
><br>
> Note that I have also been trying with the master and the next version<br>
> of cmake, same thing...<br>
><br>
> Thanks,<br>
> Arnaud<br>
><br>
<br>
</div></div>Looks to me like the symlink /usr/lib/libboost_graph-mt.so doesn't<br>
exist. Did you check that?<br>
<span class="HOEnZb"><font color="#888888"><br>
Michael<br>
--<br>
<br>
</font></span></blockquote></div><br><br>Michael,<br><br>You were right: the symlink was missing...<br><br>Thanks!!<br>Arnaud<br>