Results 1 to 5 of 5

Thread: [Windows + MingW32] Need for code improvement, compiling options

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2005
    Location
    Kanpur
    Posts
    14

    [Windows + MingW32] Need for code improvement, compiling options

    I am compiling the following program.... using MingW32 and Dev-C++

    #include <windows.h>
    #include <GL\glut.h>
    #include <GL\glu.h>
    #include <GL\glaux.h>


    void init()//easy name to remember
    {
    glClearColor(1,0,0,1);
    glOrtho(0,1,0,1,0,1);
    }

    void display()
    {
    glClear(GL_COLOR_BUFFER_BIT);
    glFlush();
    }

    int main(int argc, char **argv)
    {
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_RGB|GLUT_SINGLE);
    glutInitWindowSize(800,600);
    glutInitWindowPosition(5,20);
    glutCreateWindow("Tutorial 1");
    init();
    glutDisplayFunc(display);
    glutMainLoop();
    return 0;
    }

    I compiled in the following manner ... but there are certain error messages now... Please help....

    Compiler: Default compiler
    Executing g++.exe...
    g++.exe "D:\shudh\ccodes\ogl_vertex_data\ogl_vertex_data\t est.cpp" -o "D:\shudh\ccodes\ogl_vertex_data\ogl_vertex_data\t est.exe" -I"C:\apps\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"C:\apps\Dev-Cpp\include\c++\3.4.2\backward" -I"C:\apps\Dev-Cpp\include\c++\3.4.2\mingw32" -I"C:\apps\Dev-Cpp\include\c++\3.4.2" -I"C:\apps\Dev-Cpp\include" -L"C:\apps\Dev-Cpp\lib" -lglu32 -lopengl32 -lglut -lglaux -lglut32 -mwindows
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_event.o)(.text+0x319):glut_event. c: undefined reference to `glFinish@0'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_event.o)(.text+0x374):glut_event. c: undefined reference to `wglSwapBuffers@4'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_event.o)(.text+0x3dc):glut_event. c: undefined reference to `wglSwapBuffers@4'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x18f):glut_win.c: undefined reference to `wglGetCurrentContext@0'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x196):glut_win.c: undefined reference to `wglGetCurrentDC@0'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x1b6):glut_win.c: undefined reference to `wglMakeCurrent@8'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x1d5):glut_win.c: undefined reference to `glViewport@16'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x1f7):glut_win.c: undefined reference to `wglMakeCurrent@8'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x216):glut_win.c: undefined reference to `glViewport@16'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x21e):glut_win.c: undefined reference to `wglGetCurrentContext@0'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x225):glut_win.c: undefined reference to `wglGetCurrentDC@0'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x241):glut_win.c: undefined reference to `wglMakeCurrent@8'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x843):glut_win.c: undefined reference to `wglGetCurrentContext@0'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x84a):glut_win.c: undefined reference to `wglGetCurrentDC@0'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x866):glut_win.c: undefined reference to `wglMakeCurrent@8'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x897):glut_win.c: undefined reference to `glDrawBuffer@4'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x8a6):glut_win.c: undefined reference to `glReadBuffer@4'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0xaa1):glut_win.c: undefined reference to `wglDeleteContext@4'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0xb61):glut_win.c: undefined reference to `wglMakeCurrent@8'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0xbd2):glut_win.c: undefined reference to `wglGetCurrentContext@0'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0xbd9):glut_win.c: undefined reference to `wglGetCurrentDC@0'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0xbf5):glut_win.c: undefined reference to `wglMakeCurrent@8'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0xcb4):glut_win.c: undefined reference to `wglGetCurrentContext@0'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0xcbb):glut_win.c: undefined reference to `wglGetCurrentDC@0'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0xcd7):glut_win.c: undefined reference to `wglMakeCurrent@8'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_mesa.o)(.text+0x80):glut_mesa.c: undefined reference to `glGetString@4'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_mesa.o)(.text+0x91):glut_mesa.c: undefined reference to `glGetString@4'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_util.o)(.text+0x281):glut_util.c: undefined reference to `glGetError@0'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_util.o)(.text+0x28d):glut_util.c: undefined reference to `gluErrorString@4'
    C:\apps\Dev-Cpp\lib/libglut32.a(win32_glx.o)(.text+0x30d):win32_glx.c: undefined reference to `wglCreateContext@4'
    C:\apps\Dev-Cpp\lib/libglut32.a(glut_swap.o)(.text+0x71):glut_swap.c: undefined reference to `wglSwapBuffers@4'
    C:\apps\Dev-Cpp\lib/libglut32.a(win32_winproc.o)(.text+0x292):win32_wi nproc.c: undefined reference to `joyReleaseCapture@4'
    C:\apps\Dev-Cpp\lib/libglut32.a(win32_winproc.o)(.text+0x3fc):win32_wi nproc.c: undefined reference to `joySetCapture@16'
    C:\apps\Dev-Cpp\lib/libglut32.a(win32_winproc.o)(.text+0x162f):win32_w inproc.c: undefined reference to `joyGetPosEx@8'
    C:\apps\Dev-Cpp\lib/libglut32.a(win32_winproc.o)(.text+0x171f):win32_w inproc.c: undefined reference to `joyGetPosEx@8'
    collect2: ld returned 1 exit status

    Execution terminated
    Suddhasheel GHOSH
    Chercheur Geomatique

  2. #2
    Senior Member OpenGL Pro
    Join Date
    May 2000
    Location
    Naarn, Austria
    Posts
    1,102

    Re: [Windows + MingW32] Need for code improvement, compiling options

    Just a wild guess, but try using either -lglut or -lglut32, not both of them...

  3. #3
    Junior Member Newbie
    Join Date
    Jun 2005
    Location
    Kanpur
    Posts
    14

    Re: [Windows + MingW32] Need for code improvement, compiling options

    Nopes doesnt work.... !!!!!
    Suddhasheel GHOSH
    Chercheur Geomatique

  4. #4
    Guest

    Re: [Windows + MingW32] Need for code improvement, compiling options

    Go to this page.
    http://www.cs.uofs.edu/~mpc3/cmps370/glutsetup.html
    Compiler switches are required and glut.h is different for Dev C++.

    Follow insructions (do not skip any on the page). U shall be up and running.

  5. #5
    Junior Member Newbie
    Join Date
    Jun 2005
    Location
    Kanpur
    Posts
    14

    Re: [Windows + MingW32] Need for code improvement, compiling options

    Compiler: Default compiler
    Building Makefile: "D:\shudh\ccodes\Makefile.win"
    Executing make...
    make.exe -f "D:\shudh\ccodes\Makefile.win" all
    gcc.exe main.o -o "gluttest.exe" -L"C:/apps/Dev-Cpp/lib" -lglu32 -lopengl32 -lglaux -lglut32 -mwindows C:/apps/Dev-Cpp/lib/libglut32.a C:/apps/Dev-Cpp/lib/libglu32.a C:/apps/Dev-Cpp/lib/libopengl32.a

    C:/apps/Dev-Cpp/lib/libglut32.a(win32_winproc.o)(.text+0x292):win32_wi nproc.c: undefined reference to `joyReleaseCapture@4'
    C:/apps/Dev-Cpp/lib/libglut32.a(win32_winproc.o)(.text+0x3fc):win32_wi nproc.c: undefined reference to `joySetCapture@16'
    C:/apps/Dev-Cpp/lib/libglut32.a(win32_winproc.o)(.text+0x162f):win32_w inproc.c: undefined reference to `joyGetPosEx@8'
    C:/apps/Dev-Cpp/lib/libglut32.a(win32_winproc.o)(.text+0x171f):win32_w inproc.c: undefined reference to `joyGetPosEx@8'
    collect2: ld returned 1 exit status

    make.exe: *** [gluttest.exe] Error 1

    Execution terminated
    Suddhasheel GHOSH
    Chercheur Geomatique

Similar Threads

  1. Glui, Windows, mingw32
    By ricardovich in forum OpenGL: General
    Replies: 0
    Last Post: 12-04-2008, 07:37 PM
  2. [Windows + MingW32] Help required compiler options
    By Suddhasheel in forum OpenGL: Windows
    Replies: 3
    Last Post: 02-07-2006, 03:07 PM
  3. Problem with this code and mingw32
    By Rulz in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 03-08-2002, 08:15 AM
  4. Compiling Mesa 4 with Mingw32?
    By Rulz in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 11-05-2001, 11:18 AM
  5. Compiling Mesa under MS Windows, using mingw32....
    By Muniz in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 10-11-2000, 06:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean