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請寄給我
嗨Kamel,歡迎來到SO。只是幾個提示。請給你的文章一個適當的標題和標誌。如果您有錯誤,請將相關內容添加到您的帖子中。在這種情況下,您可能想知道您的開發環境是什麼以及如何編譯您的程序。特別是關於鏈接。 – Bart