<DIV>Hi:</DIV> <DIV> </DIV> <DIV><FONT face=verdana>I am a newbie to the world of Boost.</FONT></DIV> <DIV><FONT face=verdana></FONT> </DIV> <DIV><FONT face=verdana>I have a problem in compiling a program. I do not know how to set the path to compile the attached code.</FONT></DIV> <DIV><FONT face=verdana></FONT> </DIV> <DIV><FONT face=verdana>My platform is Cygwin</FONT></DIV> <DIV><FONT face=verdana>gcc version 3.3.3</FONT></DIV> <DIV><FONT face=verdana></FONT> </DIV> <DIV><FONT face=verdana>The boost_1_32_0 subdirectory resides in the Cygwin directory.</FONT></DIV> <DIV><FONT face=verdana></FONT> </DIV> <DIV> <DIV><FONT face=verdana>I tried the following,</FONT></DIV> <DIV><FONT face=verdana></FONT> </DIV> <DIV><FONT face=verdana>g++ boost_1_32_0/boost/graph/sourcecode.cpp</FONT></DIV> <DIV><FONT face=verdana></FONT> </DIV> <DIV><FONT face=verdana>and it displays the message</FONT></DIV> <DIV><FONT face=verdana>boost/config.hpp : No such file or directory</FONT></DIV> <DIV><FONT face=verdana>boost/graph/graph_traits.hpp : No such file or directory<BR>boost/graph/adjacency_list.hpp : No such file or directory<BR>boost/graph/dijkstra_shortest_paths.hpp : No such file or directory</FONT></DIV> <DIV><FONT face=verdana></FONT> </DIV> <DIV><FONT face=verdana>followed by more error messages. Please refer to the attached code and help me out.</FONT></DIV> <DIV><FONT face=Verdana></FONT> </DIV> <DIV><FONT face=verdana>Thanks in advance.</FONT></DIV> <DIV><FONT face=verdana></FONT> </DIV> <DIV> <DIV><FONT face=verdana>Sourcecode.cpp</FONT></DIV></DIV> <DIV><FONT face=verdana>******************************************************************************</FONT></DIV> <DIV><FONT face=verdana>#include <boost/config.hpp><BR>#include <iostream><BR>#include <fstream><BR>#include <string></FONT></DIV> <DIV><FONT face=verdana>#include <boost/graph/graph_traits.hpp><BR>#include <boost/graph/adjacency_list.hpp><BR>#include <boost/graph/dijkstra_shortest_paths.hpp></FONT></DIV> <DIV><FONT face=verdana>using namespace boost;</FONT></DIV> <DIV><FONT face=verdana>float maximum(float a[], float mx, int n){<BR> float max=mx;<BR> for(int i=0; i<n; ++i){<BR> if(max < a[i]){<BR> max=a[i];<BR> }<BR> }<BR> return max;<BR>}</FONT></DIV> <DIV><FONT face=verdana>int main()<BR>{<BR> int num_nodes = 10000; <BR> int num_PPIs = 50000; <BR> char node[num_nodes][10], p1[num_PPIs][10], p2[num_PPIs][10];<BR> char name[num_nodes];<BR> float wt[num_PPIs], apl, dia, path[num_nodes];<BR> int i, j, l, l1, l2, mx_len=num_nodes, pl[mx_len];</FONT></DIV> <DIV><FONT face=verdana> typedef adjacency_list < listS, vecS, directedS,<BR> no_property, property < edge_weight_t, float > > graph_t;<BR> typedef graph_traits < graph_t >::vertex_descriptor vertex_descriptor;<BR> typedef graph_traits < graph_t >::edge_descriptor edge_descriptor;<BR> typedef std::pair<int, int> Edge;</FONT></DIV> <DIV><FONT face=verdana> std::ifstream INF1 ("./data/None.conversion");<BR> std::ifstream INF2 ("./data/None.before");<BR> if(!INF1){<BR> std::cerr << "Cannot find INF1 file." << std::endl;<BR> return EXIT_FAILURE;<BR> }<BR> if(!INF2){<BR> std::cerr << "Cannot find INF2 file." << std::endl;<BR> return EXIT_FAILURE;<BR> }<BR> //read data<BR> i=0;<BR> while(INF1 >> num_nodes >> node[i]){ <BR> ++i;<BR> }<BR> INF1.close();<BR> num_nodes=i;<BR> i=0;<BR> while(INF2 >> p1[i] >> p2[i] >> wt[i]){<BR> wt[i]=1.0; <BR> ++i;<BR> }<BR> INF2.close();<BR> num_PPIs=i;<BR> //<BR> Edge edge_array[num_PPIs];<BR> for(i=0; i<num_PPIs; ++i){<BR> for(j=0; j<num_nodes; ++j){<BR> if(stricmp(p1[i],node[j]) == 0){<BR> edge_array[i].first=j;<BR> }<BR> }<BR> for(j=0; j<num_nodes; ++j){<BR> if(stricmp(p2[i],node[j]) == 0){<BR> edge_array[i].second=j;<BR> }<BR> }<BR> }<BR> //<BR> int num_arcs = sizeof(edge_array) / sizeof(Edge); <BR> std::cout << "0 None " << num_PPIs << " " << num_nodes;<BR> graph_t g(edge_array, edge_array + num_arcs, wt, num_nodes);<BR> property_map<graph_t, edge_weight_t>::type weightmap = get(edge_weight, g);<BR> std::vector<vertex_descriptor> p(num_vertices(g));<BR> std::vector<float> d(num_vertices(g));<BR> //<BR> l1=0;<BR> l2=0;<BR> dia=0;<BR> for(j=1; j<mx_len; ++j){<BR> pl[j]=0;<BR> }<BR> //<BR> for(int src=0; src<num_nodes; ++src){<BR> vertex_descriptor s = vertex(src, g); <BR> dijkstra_shortest_paths(g, s, predecessor_map(&p[0]).distance_map(&d[0]));<BR> for(j=0; j<num_nodes; ++j){<BR> if(j == p[j]){ //set self-looping node to zero distance<BR> d[j]=0;<BR> }<BR> if(d[j] > 10000){ //set non-connecting node to zero distance<BR> d[j]=0;<BR> }<BR> path[j]=d[j];<BR> pl[int(d[j]+0.5)]=pl[int(d[j]+0.5)]+1;<BR> }<BR> dia=maximum(path,dia,num_nodes); <BR> } <BR> for(l=1; l<=int(dia); ++l){<BR> l1=l1+pl[l]*l;<BR> l2=l2+pl[l];<BR> }<BR> apl=float(l1)/float(l2);<BR> std::cout << " " << apl << " " << l1 << " " << l2 << " " << dia << std::endl; <BR> return EXIT_SUCCESS;</FONT></DIV> <DIV><FONT face=verdana>}</FONT></DIV> <DIV><FONT face=verdana>**********************************************************************************</FONT></DIV> <DIV><FONT face=verdana></FONT> </DIV> <DIV><FONT face=verdana>Cheers</FONT></DIV> <DIV><FONT face=verdana></FONT> </DIV> <DIV><FONT face=verdana>Grek</FONT></DIV> <DIV> </DIV> <DIV> </DIV> <DIV> </DIV></DIV><p> <hr size=1>Do you Yahoo!?<br> Yahoo! Search presents - <a href="http://us.rd.yahoo.com/evt=30648/*http://movies.yahoo.com/movies/feature/jibjabinaugural.html">Jib Jab's 'Second Term'</a>