我有這個任務,因爲需要使用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相關的,雖然我仍然不確定需要包含哪些附加庫。
它可能不是它,但嘗試更改順序,使-lglu32在fltk庫之前。 你也確定它:-lGLU32 -lOpenGL32而不是-lGLU -lGL? – Amro 2009-11-12 03:04:13