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