简体   繁体   English

Cygwin中使用Eclipse的FLTK(链接错误)

[英]FLTK in Cygwin using Eclipse (Linking errors)

I have this assignment due that requires the usage of FLTK. 我有此作业,因为这需要使用FLTK。 The code is given to us and it should compile straight off of the bat, but I am having linking errors and do not know which other libraries I need to include. 该代码已提供给我们,应该立即进行编译,但是我遇到了链接错误,并且不知道需要添加哪些其他库。

I currently have "opengl32", "fltk_gl", "glu32", and "fltk" included (-l), each of which seem to reduce the number of errors. 我目前有(-l)包含“ opengl32”,“ fltk_gl”,“ glu32”和“ fltk”,它们似乎都减少了错误的数量。 I compiled FLTK using make with no specified options. 我使用没有指定选项的make编译了FLTK。 Including all of the produced library files doesn't fix the problem, and I'm convinced that it's just some Windows specific problem. 包括所有产生的库文件并不能解决问题,并且我确信这只是某些Windows特定的问题。

Compile log: 编译日志:

**** 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 `_SelectPalette@12'
/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 `_RealizePalette@4'
/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 `_glDrawBuffer@4'
/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 `_glReadBuffer@4'
/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 `_glGetIntegerv@8'
/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 `_glOrtho@48'
/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 `_SwapBuffers@4'
...and lots more

Thanks a ton for the help. 非常感谢您的帮助。

EDIT: These first few lines are obviously OpenGL related, although I'm still not sure what additional libraries need to be included. 编辑:这些前几行显然与OpenGL有关,尽管我仍然不确定需要包括哪些其他库。

Just a guess: your makefile was written for Linux, and on Cygwin some libraries are either missing or in a different place. 只是一个猜测:您的makefile是为Linux编写的,而在Cygwin上,某些库要么丢失,要么在其他地方。 You're going to have to examine the makefile, locate the missing libraries, and either move the libs to where the makefile expects them or change the makefile to look in the right place. 您将必须检查makefile,找到丢失的库,然后将库移动到makefile期望它们的位置,或者将makefile更改为正确的位置。

The libraries it needs are listed on the line starting g++ (prepend 'lib' to the names after the -l flags) 它所需的库在以g++开头的行上列出(在-l标志后的名称前加“ lib”)

抱歉,缺少闭包功能,但我只是启动了Linux上网本并使其正常运行。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM