Hi,
Im using Dev C++. And am having trouble getting OpenGL to display in a FLTK Window. Im totally new to both c++ in general. However can code in C & Java (so understand most commands & OO).
I have followed the tutorial located (
www.gidforums.com ) to get a Hello World Program to display in FLTK. That part works fine. I have also installed the OpenGLUT Package in Dev C++, and this displays A rotating triangle fine.
However, when i try to use the following code (
seriss.com ) to test a simple OpenGL + FLTK example. I get errors.
I think its because Im not using both the OpenGL & FLTK Packages at the same time. Could some one please tell me how to get rid of the following errors.
Code:
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
g++.exe -c main.cxx -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
windres.exe -i Project1_private.rc --input-format=rc -o Project1_private.res -O coff
g++.exe main.o Project1_private.res -o "Project1.exe" -L"C:/Dev-Cpp/lib" -mwindows -lfltk -lole32 -luuid -lcomctl32 -lwsock32 -lm
main.o(.text$_ZN10MyGlWindowD1Ev[MyGlWindow::~MyGlWindow()]+0x16):main.cxx: undefined reference to `Fl_Gl_Window::~Fl_Gl_Window()'
main.o(.text$_ZN12Fl_Gl_WindowC2EiiiiPKc[Fl_Gl_Window::Fl_Gl_Window(int, int, int, int, char const*)]+0x6f):main.cxx: undefined reference to `vtable for Fl_Gl_Window'
main.o(.text$_ZN12Fl_Gl_WindowC2EiiiiPKc[Fl_Gl_Window::Fl_Gl_Window(int, int, int, int, char const*)]+0x81):main.cxx: undefined reference to `Fl_Gl_Window::init()'
main.o(.rdata$_ZTV10MyGlWindow[vtable for MyGlWindow]+0x1c):main.cxx: undefined reference to `Fl_Gl_Window::flush()'
main.o(.rdata$_ZTV10MyGlWindow[vtable for MyGlWindow]+0x20):main.cxx: undefined reference to `Fl_Gl_Window::show()'
main.o(.rdata$_ZTV10MyGlWindow[vtable for MyGlWindow]+0x24):main.cxx: undefined reference to `Fl_Gl_Window::hide()'
main.o(.rdata$_ZTV10MyGlWindow[vtable for MyGlWindow]+0x28):main.cxx: undefined reference to `Fl_Gl_Window::draw_overlay()'
main.o(.text$_ZN10MyGlWindow6resizeEiiii[MyGlWindow::resize(int, int, int, int)]+0x29):main.cxx: undefined reference to `Fl_Gl_Window::resize(int, int, int, int)'
main.o(.text$_ZN10MyGlWindow6resizeEiiii[MyGlWindow::resize(int, int, int, int)]+0x2e):main.cxx: undefined reference to `glLoadIdentity@0'
main.o(.text$_ZN10MyGlWindow6resizeEiiii[MyGlWindow::resize(int, int, int, int)]+0x50):main.cxx: undefined reference to `glViewport@16'
main.o(.text$_ZN10MyGlWindow6resizeEiiii[MyGlWindow::resize(int, int, int, int)]+0x97):main.cxx: undefined reference to `glOrtho@48'
main.o(.text$_ZN10MyGlWindow4drawEv[MyGlWindow::draw()]+0x2e):main.cxx: undefined reference to `glLoadIdentity@0'
main.o(.text$_ZN10MyGlWindow4drawEv[MyGlWindow::draw()]+0x62):main.cxx: undefined reference to `glViewport@16'
main.o(.text$_ZN10MyGlWindow4drawEv[MyGlWindow::draw()]+0xeb):main.cxx: undefined reference to `glOrtho@48'
main.o(.text$_ZN10MyGlWindow4drawEv[MyGlWindow::draw()]+0xfa):main.cxx: undefined reference to `glClear@4'
main.o(.text$_ZN10MyGlWindow4drawEv[MyGlWindow::draw()]+0x11c):main.cxx: undefined reference to `glColor3f@12'
main.o(.text$_ZN10MyGlWindow4drawEv[MyGlWindow::draw()]+0x12b):main.cxx: undefined reference to `glBegin@4'
main.o(.text$_ZN10MyGlWindow4drawEv[MyGlWindow::draw()]+0x166):main.cxx: undefined reference to `glVertex2f@8'
main.o(.text$_ZN10MyGlWindow4drawEv[MyGlWindow::draw()]+0x1a5):main.cxx: undefined reference to `glVertex2f@8'
main.o(.text$_ZN10MyGlWindow4drawEv[MyGlWindow::draw()]+0x1ad):main.cxx: undefined reference to `glEnd@0'
main.o(.text$_ZN10MyGlWindow4drawEv[MyGlWindow::draw()]+0x1b9):main.cxx: undefined reference to `glBegin@4'
main.o(.text$_ZN10MyGlWindow4drawEv[MyGlWindow::draw()]+0x1f6):main.cxx: undefined reference to `glVertex2f@8'
main.o(.text$_ZN10MyGlWindow4drawEv[MyGlWindow::draw()]+0x233):main.cxx: undefined reference to `glVertex2f@8'
main.o(.text$_ZN10MyGlWindow4drawEv[MyGlWindow::draw()]+0x23b):main.cxx: undefined reference to `glEnd@0'
main.o(.text$_ZN10MyGlWindowD0Ev[MyGlWindow::~MyGlWindow()]+0x16):main.cxx: undefined reference to `Fl_Gl_Window::~Fl_Gl_Window()'
collect2: ld returned 1 exit status
make.exe: *** [Project1.exe] Error 1
Execution terminated