Errors compiling with latest opengl sdk

I downloaded the latest opengl 1.2 sdk and i’m having problems compiling using GLUT. I read the glut 3.7 readme and i still don’t know whats going on.

I wrote a simple glut program to make it easy to see what i mean, plus i’ll post my errors. I’m using codewarrior 5.1

#include <stdlib.h>
#include <GL/glut.h>

void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0, 1.0, 0.5);
glBegin(GL_TRIANGLES);
glVertex2f(0.0, 0.0);
glVertex2f(1.0, 2.0);
glVertex2f(2.0, 0.0);
glEnd();

glFlush;
}

void init(void)
{
glClearColor(0.0, 0.0, 0.0, 0.0);
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);
glutInitWindowPosition(100, 100);
glutInitWindowSize(400, 400);
glutCreateWindow(“hello”);
init();
glutDisplayFunc(display);
glutMainLoop();
return 0;
}

these are the errors i’m getting…
Error : declaration syntax error
GL/glut.h line 435 //extern int APIENTRY glutCreatePlainWindow(const char *title);

Error : declaration syntax error
GL/glut.h line 484 //extern void APIENTRY glutAttachMenuName(int button, char *menu_name);

i’m not sure why i’m getting these errors.
I even commented those lines out in the GL/glut.h file. Then i get a whole list of errors where glut functions are not defined.

One more thing, anyone know where to get the tk.h file? I seemed to have lost it and i can’t remember where to download it.

Cheers

Do you want to send me the codewarrior project

g.r.powell@cs.cf.ac.uk

Do you want to send me the codewarrior project

g.r.powell@cs.cf.ac.uk

Hey Gavin, thanks for the help, but i figured(with some help from idevgames.com) out the problem.

Cheers and take care.

glad you fixed in 9600man - I saw your post at xlr8yourmac but have been awol (read ill)
l8r

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.