Hello,
I am using the Borland C++ 5.5.1 command line compiler to compile OpenGl code with Glut 3.7. However, when I type bcc32 main.cpp I get error 2337, “glut.h 140: only one of a set of overloaded functions can be “C”.” I am doing this on WIN98, ME, and NT 4.0 and get the same error. I have used the implib tool to convert glut32.dll, opengl32.dll, and glu32.dll to .lib files. I have also set the path in my .cfg files to c:\borland\bcc55\Lib and c:\borland\bss55\Include and c:\borland\bcc55\Include\Gl. The code compiles and runs in Visual C++ 5.0. I would appreciate some help in solving this problem. Thanks in advance for the help!
#ifdef FLAT
#include <windows.h>
#endif
#include <gl/glut.h>
// The initialisation function
void init(void)
{
glClearColor(1.0, 1.0, 1.0, 0.0) ;
glShadeModel(GL_FLAT) ;
}
// The display function
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT) ;
glutSwapBuffers() ;
}
// The main function
int main(int argc, char** argv)
{
glutInit(&argc, argv) ;
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB) ;
glutInitWindowSize(400, 400) ;
glutInitWindowPosition(100, 100) ;
glutCreateWindow(“Second Chapter - Opening an OpenGL Window”) ;
init() ;
glutDisplayFunc(display) ;
glutMainLoop() ;
return 0 ;
}