Results 1 to 7 of 7

Thread: Easy OpenGL Prog, don't run

  1. #1

    Easy OpenGL Prog, don't run

    Hi

    I read the OpenGL Programming Guide. But I can't run the first program. Can anybody help me please?

    The Program:
    #include "windows.h"
    #include "GL\gl.h"
    #include "GL\glaux.h"

    void main ()
    {
    auxInitDisplayMode(AUX_SINGLE | AUX_RGBA);
    auxInitPosition(0,0,500,500);
    auxInitWindow("Test");

    glClearColor(0.0,0.0,0.0,0.0);
    glClear(GL_COLOR_BUFFER_BIT);
    glColor3f(1.0,1.0,1.0);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glOrtho(-1.0,1.0,-1.0,1.0,-1.0,1.0);
    glBegin(GL_POLYGON);
    glVertex2f(-0.5,-0.5);
    glVertex2f(-0.5,0.5);
    glVertex2f(0.5,0.5);
    glVertex2f(0.5,-0.5);
    glEnd();
    glFlush();


    Sleep(10);

    }

    The Error:

    --------------------Konfiguration: OpenGL2 - Win32 Debug--------------------
    Linker-Vorgang läuft...
    main.obj : error LNK2001: Nichtaufgeloestes externes Symbol __imp__glFlush@0
    main.obj : error LNK2001: Nichtaufgeloestes externes Symbol __imp__glEnd@0
    main.obj : error LNK2001: Nichtaufgeloestes externes Symbol __imp__glVertex2f@8
    main.obj : error LNK2001: Nichtaufgeloestes externes Symbol __imp__glBegin@4
    main.obj : error LNK2001: Nichtaufgeloestes externes Symbol __imp__glOrtho@48
    main.obj : error LNK2001: Nichtaufgeloestes externes Symbol __imp__glLoadIdentity@0
    main.obj : error LNK2001: Nichtaufgeloestes externes Symbol __imp__glMatrixMode@4
    main.obj : error LNK2001: Nichtaufgeloestes externes Symbol __imp__glColor3f@12
    main.obj : error LNK2001: Nichtaufgeloestes externes Symbol __imp__glClear@4
    main.obj : error LNK2001: Nichtaufgeloestes externes Symbol __imp__glClearColor@16
    main.obj : error LNK2001: Nichtaufgeloestes externes Symbol _auxInitWindowA@4
    main.obj : error LNK2001: Nichtaufgeloestes externes Symbol _auxInitPosition@16
    main.obj : error LNK2001: Nichtaufgeloestes externes Symbol _auxInitDisplayMode@4
    LIBCD.lib(wincrt0.obj) : error LNK2001: Nichtaufgeloestes externes Symbol _WinMain@16
    Debug/OpenGL2.exe : fatal error LNK1120: 14 unaufgeloeste externe Verweise
    Fehler beim Ausführen von link.exe.

    OpenGL2.exe - 15 Fehler, 0 Warnung(en)

    Please help me!!!!

    Much thanks

  2. #2
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,450

    Re: Easy OpenGL Prog, don't run

    Uff, German compiler
    You need to add OPENGL32.LIB and GLAUX.LIB to the linker files and _WinMain implies you translate a Windows project, but yours is a console program.

  3. #3

    Re: Easy OpenGL Prog, don't run

    I use Visual C++ 6.
    How to do this?

    Much thanks. Sorry I am a C++ beginner.

  4. #4
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,450

    Re: Easy OpenGL Prog, don't run

    Know your tools!
    Sorry, I have no German version.

    Go to Project->Settings->Link, put the cursor in the "Object/Library modules" edit field and type opengl32.lib glu32.lib glaux.lib.

    If that's not helping because of the WinMain problem generate a new console project File->New->Projects->Win32 Console Application start all over with the above.

    Compare your compiler settings with some makefiles from the SDK GLAUX demos coming with the compiler!

    But I'd suggest you skip glaux completely (it's dead) and start with GLUT (search www.opengl.org or more info on that.)

  5. #5
    Guest

    Re: Easy OpenGL Prog, don't run

    Du gehst in

    Projekt/Einstellungen

    <Einstellungen für> stellst Du auf: Alle Konfigurationen dann auf die Registerkarte Linker, dort fügst Du in die Zeile Objekt-/Bibliothek-Module am Ende opengl32.lib ein. Dann sollte alles laufen!

    Viel Spass

  6. #6

    Re: Easy OpenGL Prog, don't run

    It doesn't help.
    I try to start with glut, if it is better.

    much thanks to you

  7. #7

    Re: Easy OpenGL Prog, don't run

    Juhu, es läuft!!! Danke

    It runs, thanks

Similar Threads

  1. how to insert keyboard func in opengl prog
    By abhishek21 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-04-2015, 05:31 AM
  2. opengl 3d prog
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 01-03-2005, 05:35 PM
  3. importing maya models into opengl prog.
    By llester in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 01-23-2003, 07:13 AM
  4. Replies: 0
    Last Post: 01-16-2003, 09:22 AM
  5. Replies: 6
    Last Post: 06-09-2000, 12:21 AM

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