Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

bsdpowa

errors in GLUT code

This topic is 5280 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, im trying to do some ogl stuff, im reading the Redbook, chapter 1 and i got to this glut example, i did exactly as it''s said in the book but i get errors.can anyone help me? #include <windows.h> #include <gl/gl.h> #include <gl/glut.h> void display(void) { glClear(GL_COLOR_BUFFER_BIT); 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) { 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); glutInitWindowSize(230, 230); glutInitWindowPosition(100, 100); glutCreateWindow("test2"); init(); glutDisplayFunc(display); glutMainLoop(); return 0; } --------------------Configuration: test2 - Win32 Debug-------------------- Compiling... test2.cpp Linking... LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 Debug/test2.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. test2.exe - 2 error(s), 0 warning(s)

Share this post


Link to post
Share on other sites
Advertisement
Your problem is unrelated to OpenGL or GLUT. You simply need to set up your program with the "Console application" subsystem. It should be somewhere in the project options.


"Sneftel is correct, if rather vulgar." --Flarelocke

Share this post


Link to post
Share on other sites
replace this

#include <windows.h>
#include <gl/gl.h>
#include <gl/glut.h>
.
.

with

#include <gl/glut.h>
.
.

and set up your program as a Console application instead of GUI app.

Sincerely,
Rafal Pielech

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!