trouble_shooting.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <HTML>
  2. <!--
  3. Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
  4. Distributed under the Boost Software License, Version 1.0.
  5. (See accompanying file LICENSE_1_0.txt or copy at
  6. http://www.boost.org/LICENSE_1_0.txt)
  7. -->
  8. <Head>
  9. <Title>Boost Graph Library: Trouble Shooting</Title>
  10. <BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
  11. ALINK="#ff0000">
  12. <IMG SRC="../../../boost.png"
  13. ALT="C++ Boost" width="277" height="86">
  14. <BR Clear>
  15. <h1>Trouble Shooting</h1>
  16. <hr>
  17. With GNU C++, if you see the following error message:
  18. <pre>
  19. boost/type_traits/arithmetic_traits.hpp:243: template instantiation depth exceeds maximum of 17
  20. boost/type_traits/arithmetic_traits.hpp:243: (use -ftemplate-depth-NN to increase the maximum)
  21. </pre>
  22. then you need to do as the error message advises and increase the
  23. template instantiation depth. Passing the flag
  24. <tt>-ftemplate-depth-30</tt> to g++ usually does the trick.
  25. <hr>
  26. <pre>
  27. error C2784: 'T __cdecl source(struct std::pair<T,T>,const G &)' :
  28. could not deduce template argument for 'struct std::pair<_T1,_T1>' from
  29. 'class boost::detail::bidir_edge<struct boost::bidirectional_tag,unsigned int>'
  30. </pre>
  31. <p>
  32. VC++ does not support Koenig Lookup, therefore you need to refer to functions defined in the boost namespace
  33. using the <tt>boost::</tt> prefix, i.e., <tt>boost::source(e, g)</tt> instead of <tt>source(e, g)</tt>.
  34. <hr>
  35. <pre>
  36. ../../..\boost/property_map.hpp(283) : error C2678: binary '[' : no operator defined
  37. which takes a left-hand operand of type 'const struct boost::adj_list_edge_property_map<struct
  38. boost::bidirectional_tag,struct boost::property<enum boost::edge_weight_t,int,struct
  39. boost::no_property>,unsigned int,enum boost::edge_weight_t>' (or there is no acceptable conversion)
  40. </pre>
  41. <p>There is a VC++ bug that appears when using <tt>get(property,
  42. graph, edge)</tt>. A workaround is to use <tt>get(get(property,
  43. graph), edge)</tt> instead. <i>Note that <tt>boost/property_map.hpp</tt> has
  44. now been moved to <tt>boost/property_map/property_map.hpp</tt>.
  45. <hr>
  46. <pre>
  47. C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xmemory(59) : fatal
  48. error C1001: INTERNAL COMPILER ERROR
  49. (compiler file 'msc1.cpp', line 1786)
  50. </pre>
  51. <p>There can be many reasons for this error, but sometimes it is
  52. caused by using the flag <tt>/Gm</tt> (minimal rebuild). As this flag
  53. is not really necessary, it is a good idea to turn it off.
  54. <p>
  55. Another reason for the error can be the use of the named-parameter
  56. interface for many of the BGL algorithms. Try using the non
  57. named-parameter version of the algorithm instead (see the HTML docs
  58. for the algorithm in question).
  59. <p>
  60. Yet another reason can be the use of the <tt>get()</tt> function of
  61. the <a href"PropertyGraph.html">PropertyGraph</a> interface. Instead
  62. of using the <tt>get()</tt> function in a complex expression, always
  63. declare a property map variable first:
  64. <pre>
  65. property_map&lt;graph_t, edge_weight_t&gt;::type w_map = get(edge_weight, g);
  66. // use w_map ...
  67. </pre>
  68. <hr>
  69. <pre>
  70. V:\3rdPARTY\SXL\INCLUDE\xlocnum(309) : error C2587: '_U' : illegal
  71. use of local variable as default parameter
  72. </pre>
  73. <p>
  74. Workaround from Andreas Scherer:<br>
  75. That's the usual problem with MSVC-- 6.0 sp[34] when compiling some
  76. (or all?) of the BGL examples. You can't use the DLL version of the
  77. run-time system. I succeeded in compiling file_dependencies.cpp after
  78. switching to ``[Debug] Multithreaded'' (section ``Code Generation'' on
  79. page ``C/C++'' in the ``Project Settings'').
  80. <p>
  81. Another reason for this error is when the iterator constructor of an
  82. <tt>adjacency_list</tt> is used. The workaround is to use
  83. <tt>add_edge()</tt> instead. Replace something like this:
  84. <pre>
  85. Graph g(edge_array, edge_array + n_edges, N);
  86. </pre>
  87. with something like this:
  88. <pre>
  89. Graph g(N);
  90. for (std::size_t j = 0; j < n_edges; ++j)
  91. add_edge(edge_array[j].first, edge_array[j].second, g);
  92. </pre>
  93. <hr>
  94. <br>
  95. <HR>
  96. <TABLE>
  97. <TR valign=top>
  98. <TD nowrap>Copyright &copy; 2000-2001</TD><TD>
  99. <A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
  100. Indiana University (<A
  101. HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
  102. <A HREF="http://www.boost.org/people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@cs.indiana.edu</A>)<br>
  103. <A HREF="https://homes.cs.washington.edu/~al75">Andrew Lumsdaine</A>,
  104. Indiana University (<A
  105. HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
  106. </TD></TR></TABLE>
  107. </BODY>
  108. </HTML>