2009-11-12 63 views
1

我有這個任務,因爲需要使用FLTK。該代碼給我們,它應該直接編譯蝙蝠,但我有鏈接錯誤,不知道我需要包括哪些其他庫。使用Eclipse在Cygwin中FLTK(鏈接錯誤)

我目前有「opengl32」,「fltk_gl」,「glu32」和「fltk」包括在內(-l),每個似乎都減少了錯誤的數量。我使用make編譯了FLTK,沒有指定選項。包括所有生成的庫文件不能解決問題,我確信這只是一些Windows特定的問題。

編譯日誌:

**** Build of configuration Debug for project CG5 **** 

make all 
Building target: CG5.exe 
Invoking: Cygwin C++ Linker 
g++ -o"CG5.exe" ./src/draw_routines.o ./src/gl_window.o ./src/my_shapes.o ./src/shape.o ./src/shapes_ui.o ./src/tesselation.o -lopengl32 -lfltk_z -lfltk_gl -lglu32 -lfltk 
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libfltk_gl.a(Fl_Gl_Window.o):Fl_Gl_Window.cxx:(.text+0x197): undefined reference to `[email protected]' 
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libfltk_gl.a(Fl_Gl_Window.o):Fl_Gl_Window.cxx:(.text+0x1a7): undefined reference to `[email protected]' 
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libfltk_gl.a(Fl_Gl_Window.o):Fl_Gl_Window.cxx:(.text+0x1fe): undefined reference to `[email protected]' 
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libfltk_gl.a(Fl_Gl_Window.o):Fl_Gl_Window.cxx:(.text+0x20d): undefined reference to `[email protected]' 
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libfltk_gl.a(Fl_Gl_Window.o):Fl_Gl_Window.cxx:(.text+0x23a): undefined reference to `[email protected]' 
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libfltk_gl.a(Fl_Gl_Window.o):Fl_Gl_Window.cxx:(.text+0x2c3): undefined reference to `[email protected]' 
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libfltk_gl.a(Fl_Gl_Window.o):Fl_Gl_Window.cxx:(.text+0x2f3): undefined reference to `[email protected]' 
...and lots more 

由於一噸的幫助。

編輯:這些第一行顯然是與OpenGL相關的,雖然我仍然不確定需要包含哪些附加庫。

+0

它可能不是它,但嘗試更改順序,使-lglu32在fltk庫之前。 你也確定它:-lGLU32 -lOpenGL32而不是-lGLU -lGL? – Amro 2009-11-12 03:04:13

回答

0

對不起,我沒有關閉,但我只是啓動到我的Linux上網本,得到它加工。

-lfltk -lfltk_gl -lGLU -lGL -lXext -lX11 -lm 
0

只是猜測:你的makefile是爲Linux編寫的,而在Cygwin上,一些庫或者丟失或者在不同的地方。您將必須檢查makefile,找到缺少的庫,然後將庫移動到makefile所期望的位置,或者將makefile改爲在正確位置查找。

其所需的庫列上(在-l標誌之後在前面加上「LIB」的名字)開始g++