Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/graph/doc/trouble_shooting.html @ 12

Last change on this file since 12 was 12, checked in by landauf, 18 years ago

added boost

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