Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WINGDIAPI void APIENTRY error in gl.h

760 views
Skip to first unread message

Thomas Ashbrook

unread,
Jun 6, 1997, 3:00:00 AM6/6/97
to

I am using OpenGl for win95 and cannot get even a simple program (the
first in the Programming OpenGl book) to compile. I get LOTS of errors
in gl.h about the section of code that resembles:

WINGDIAPI void APIENTRY GLsomefunction ( paraeters....)
....
....
....

I have wing installed and have included the proper header files (I
think) and nothing works. I know this is a simple problem but I can't
figure it out for anything. Any ideas or insight???

TIA,
Tom.
--
"Vital papers will demonstrate their vitality by moving from where you
left them to where you can't find them."

Michael I. Gold

unread,
Jun 7, 1997, 3:00:00 AM6/7/97
to

Thomas Ashbrook <tas...@ix.netcom.com> writes:

| I am using OpenGl for win95 and cannot get even a simple program (the
| first in the Programming OpenGl book) to compile. I get LOTS of errors
| in gl.h about the section of code that resembles:
|
| WINGDIAPI void APIENTRY GLsomefunction ( paraeters....)

You must include <windows.h> before <GL/gl.h>.
--
Michael I. Gold Silicon Graphics Inc. http://reality.sgi.com/gold
And my mama cried, "Nanook a no no! Don't be a naughty eskimo! Save your
money, don't go to the show!" Well I turned around and I said, "Ho! Ho!"

Thomas Ashbrook

unread,
Jun 7, 1997, 3:00:00 AM6/7/97
to
That worked like a charm. don't know why I didn't think of it earlier
but know I am getting unresolved externals... in VC++4.0. Back to the
manuals...

error LNK2001: unresolved external symbol __imp__glFlush@0

Can't get any simpler than this..

#include <windows.h>
//#include <GL/Gl.h>
#include "f:\OpenGL\glut.h"

void display(void)
{
//clear all pixels
glClear(GL_COLOR_BUFFER_BIT);

//draaw a white polygon
glColor3f(1.0,1.0,1.0);
glBegin(GL_POLYGON);
glVertex3f(0.25,0.25,0.0);
glVertex3f(0.75,0.25,0.0);
glVertex3f(0.75,0.75,0.0);
glVertex3f(0.25,0.75,0.0);
glEnd();

glFlush();
}

void init(void)
{
//select background color
glClearColor(0.0,0.0,0.0,0.0);

//init viewing vlues
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0,1.0,0.0,1.0,-1.0,1.0);
}

int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(250,250);
glutInitWindowPosition(100,100);
glutCreateWindow("hello");
init();
glutDisplayFunc(display);
glutMainLoop();
return 0;

Michael I. Gold

unread,
Jun 8, 1997, 3:00:00 AM6/8/97
to

Thomas Ashbrook <tas...@ix.netcom.com> writes:

| error LNK2001: unresolved external symbol __imp__glFlush@0

You must add opengl32.lib to your library link list. If you use any of
the glu* entry points (not glut!) you must also add glu32.lib.

Ash

unread,
Jun 10, 1997, 3:00:00 AM6/10/97
to

Michael I. Gold wrote:
>
> Thomas Ashbrook <tas...@ix.netcom.com> writes:
>
> | error LNK2001: unresolved external symbol __imp__glFlush@0
>
> You must add opengl32.lib to your library link list. If you use any of
> the glu* entry points (not glut!) you must also add glu32.lib.


I know this is a horrible question, and I really should be ashamed of
myself for asking because I have been using C for almost 3 years
now...but,

How do you link in .lib files??? I know the fucntion definitions are in
those files, but I can't figure out how to link them with the .obj's to
build the executable. Is it in options->preferences? Do you have to do
it from the command line? Can you put some lines in a make file and do
it that way??? I tried that, and my program "made" without errors, but
when I ran it, it performed an illegal op in the kernel module.
(kernel32.dll) Funny thing is, it was one of Kilgard's example programs
that I was building. heh heh...

Anyone who can help...please do. :)

--
-=<Nathan Bonfiglio>=-
--==<<Ash__NightBreed>>==--
---===<<<n...@umich.edu>>>===---

0 new messages