2011-07-17 36 views
1

我是一个leda-6.3库用户。LEDA-6.3库;

我用graphwin操作和显示图形,但我发现,引用 到graphwin方法是不确定的,而编译的代码虽然他们 在LEDA /含/ LEDA声明/图形/ graphwin.h

所以我认为这是一个目标文件的问题。请有人使用LEDA-6.3可以帮助我。 真的很紧急。如果你可以编译程序操作graphwin请 发送给我你的LEDA包(Ubuntu 32位)。

#include <LEDA/graphics/graphwin.h> 
#include <LEDA/graph/graph_alg.h> 

using namespace leda; 

int main() 
{ 
GraphWin gw("LEDA Graph Editor"); 
node u=gw.new_node(point(100,100)); 
node v=gw.new_node(point(100,200)); 
gw.new_edge(u,v); 

gw.display(); 
gw.get_window().read_mouse(); 

graph& G=gw.get_graph(); 
G.new_node(); 
gw.get_window().read_mouse(); 

gw.update_graph(); 
gw.get_window().read_mouse(); 

return 0; 
} 

编译:G ++ -I $ LEDAROOT /含-L $ LEDAROOT gw.cpp -lleda -lX11 -lm -o GW

错误:

/tmp/ccVHyRbL.o: In function `main': 
gw.cpp:(.text+0x1e): undefined reference to `leda::GraphWin::GraphWin(char const*)' 
gw.cpp:(.text+0x58): undefined reference to `leda::GraphWin::new_node(leda::point const&)' 
gw.cpp:(.text+0xc6): undefined reference to `leda::GraphWin::new_node(leda::point const&)' 
gw.cpp:(.text+0x11c): undefined reference to `leda::GraphWin::new_edge(leda::node_struct*, leda::node_struct*)' 
gw.cpp:(.text+0x128): undefined reference to `leda::GraphWin::display()' 
gw.cpp:(.text+0x17e): undefined reference to `leda::GraphWin::update_graph()' 
collect2: ld returned 1 exit status 

如果有人有LEDA-5.2请寄给我

+0

嗨Kamel,欢迎来到SO。只是几个提示。请给你的文章一个适当的标题和标志。如果您有错误,请将相关内容添加到您的帖子中。在这种情况下,您可能想知道您的开发环境是什么以及如何编译您的程序。特别是关于链接。 – Bart

回答

0

你正在使用哪个版本的LEDA? 请考虑免费版的LEDA不包含GraphWin。 因此,它不包含GraphWin库,这会导致在编译程序时出现此类错误。