hi list
I am using boost to build a small tool that generate a
(GRAPHICAL) graph showing dependecies between files ;)
I donc guess why g++ returns to me this error.
any input will be helpful
thanks
Ps : excuse me. I will copy all the source file and the error.
you can find it a long.
#include
#include
#include
#include
#include
#include
#include
#include <fstream>
#include <string>
#include <iostream>
#include <algorithm>
#include <string>
#include
#include
#include
#include
using namespace std;
using namespace boost;
enum vertex_first_name_t { vertex_first_name };
namespace boost {
BOOST_INSTALL_PROPERTY(vertex, first_name);
}
template
void who_owes_who(EdgeIter first, EdgeIter last, const Graph& G)
{
// Access the propety acessor type for this graph
typedef typename property_map
::const_type NamePA;
NamePA name = get(vertex_first_name, G);
typedef typename boost::property_traits<NamePA>::value_type
NameType;
NameType src_name, targ_name;
while (first != last) {
src_name = boost::get(name, source(*first,G));
targ_name = boost::get(name, target(*first,G));
cout << src_name << " owes "
<< targ_name << " some money" << endl;
++first;
}
}
int
main(int argc,char **argv)
{
// Create the graph, and specify that we will use std::string to
// store the first name's.
typedef adjacency_list > MyGraphType;
MyGraphType G;
property_map::type name=
get(vertex_first_name, G);
QApplication a( argc, argv );
QCanvas c;
QDir dir (".") ;
int filesnum=0;
QStringList lst = dir.entryList( "*.cpp; *.h" );
for ( QStringList::Iterator it = lst.begin(); it !=
lst.end(); ++it ) {
boost::graph_traits<MyGraphType>::vertex_descriptor v;
name[v]=*it;
add_vertex(v,G);
cerr << *it << endl;
filesnum++;
}
return 0;
}
g++ -o filetree main.cpp -I /usr/lib/qt-3.1/include -L
/usr/lib/qt-3.1/lib -lqt
Dans le fichier inclus à partir de
/usr/include/c++/3.3.2/backward/iostream.h:31,
à partir de main.cpp:4:
/usr/include/c++/3.3.2/backward/backward_warning.h:32:2:
attention : #warning This file includes at least one
deprecated or antiquated header. Please consider using one of
the 32 headers found in section 17.4.1.2 of the C++ standard.
Examples include substituting the <X> header for the
header for C++ includes, or <sstream> instead of the
deprecated header . To disable this warning use
-Wno-deprecated.
main.cpp: Dans function « int main(int, char**) »:
main.cpp:67: error: invalid initialization of reference of
type 'const
boost::property&' from
expression of type 'size_t'
/usr/include/boost/graph/detail/adjacency_list.hpp:1916:
error: in passing
argument 1 of `typename Config::vertex_descriptor
boost::add_vertex(typename
Config::vertex_property_type&, boost::vec_adj_list_impl&) [with
Graph = boost::adjacency_list,
boost::no_property, boost::no_property, boost::listS>, Config =
boost::detail::adj_list_gen, boost::no_property, boost::no_property,
boost::listS>,
boost::vecS, boost::vecS, boost::directedS,
boost::property,
boost::no_property, boost::no_property, boost::listS>::config,
Base =
boost::directed_graph_helper, boost::no_property, boost::no_property,
boost::listS>,
boost::vecS, boost::vecS, boost::directedS,
boost::property,
boost::no_property, boost::no_property, boost::listS>::config>]'
gmake: *** [filetree] Erreur 1
*** échec ***
Accédez au courrier électronique de La Poste : www.laposte.net ;
3615 LAPOSTENET (0,34/mn) ; tél : 08 92 68 13 50 (0,34/mn)