Jump to content
  • Advertisement

Archived

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

Mattman

HELP ME PLEASE!!

This topic is 6910 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

Okay, I''m supposed to be writing a Pacman game for my VC++ class in school...I chose OpenGL cause I couldn''t find anything else to use for gfx in VC++... I go to: File Menu -> New -> Files Tab -> C++ Source File -> OK button...I have the following code implemented so far: #include #include #include #include GLvoid ResizeGLScene(GLsizei width, GLsizei height) { if(height == 0) height = 1; glViewport(0, 0, width, height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(45.0f, (GLfloat)width / (GLfloat)height, 0.1f, 100.0f); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); } int InitGL(GLvoid) { glShadeModel(GL_SMOOTH); glClearColor(1.0f, 1.0f, 1.0f, 0.0f); glClearDepth(1.0f); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); return(TRUE); } int main() { HDC hDC = NULL; HGLRC hRC = NULL; HWND hWnd = NULL; HINSTANCE hInstance = NULL; bool Keys[256]; bool active = true; bool fullscreen = true; LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); ResizeGLScene(640, 480); InitGL(); return(0); } When I try to run it, I get the following errors: --------------------Configuration: Pacman - Win32 Debug-------------------- Compiling... Pacman.cpp Linking... Pacman.obj : error LNK2001: unresolved external symbol _gluPerspective@32 Pacman.obj : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0 Pacman.obj : error LNK2001: unresolved external symbol __imp__glMatrixMode@4 Pacman.obj : error LNK2001: unresolved external symbol __imp__glViewport@16 Pacman.obj : error LNK2001: unresolved external symbol __imp__glHint@8 Pacman.obj : error LNK2001: unresolved external symbol __imp__glDepthFunc@4 Pacman.obj : error LNK2001: unresolved external symbol __imp__glEnable@4 Pacman.obj : error LNK2001: unresolved external symbol __imp__glClearDepth@8 Pacman.obj : error LNK2001: unresolved external symbol __imp__glClearColor@16 Pacman.obj : error LNK2001: unresolved external symbol __imp__glShadeModel@4 Debug/Pacman.exe : fatal error LNK1120: 10 unresolved externals Error executing link.exe. Pacman.exe - 11 error(s), 0 warning(s) Can someone PLEASE help me? This is due in about a week!!!! Thanks in advance! Mattman

Share this post


Link to post
Share on other sites
Advertisement
You are forgetting to link with the OpenGL/GLU libraries. Go to Project->Settings, click on the "Link" tab and in the box where it says "Object/library modules" add "opengl32.lib" and "glu32.lib" and that should fix your problem.

-Liquid

Share this post


Link to post
Share on other sites
this may be a stupid question! but did u save the source file as a .cpp or .c make sure its a .cpp and use the settings tab to link to

opengl32.lib glu32.lib glaux.lib

Share this post


Link to post
Share on other sites
Oooh, I didn''t know I had to do that! Thank you for the quick replies! I will try that now (despite the fact that I''m at school, not home). And as for the second reply, yes, it is a .cpp! Thanks again!
Mattman
mattman@nobispro.com
www.nobispro.com

Share this post


Link to post
Share on other sites
JOY! I ran it at home, and it worked! Thank you very much again for the help! It''s great to see people who care! This whole website has been a true help, both with the tutorials, as well as with the forum!
Thank you!
Mattman
mattman@nobispro.com
www.nobispro.com

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!