Jump to content
  • Advertisement
Sign in to follow this  
BloodLust666

OpenGL including opengl library

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

for some reason, it's not seeing that i'm including the <gl/gl.h> files and whatnot... i get an error for every gl command i use. am i missing something?

Share this post


Link to post
Share on other sites
Advertisement
If you're getting errors like these
1>Linking...
1>vis_console.obj : error LNK2001: unresolved external symbol __imp__glEnd@0
1>vis_console.obj : error LNK2001: unresolved external symbol __imp__glBegin@4
1>D:/Apps/foobar2000_0.8.3/own/foo_vis_console.dll : fatal error LNK1120: 2 unresolved externals
then you are not linking your application against the opengl32.lib library. The way to do that depends on which IDE you are using.

Share this post


Link to post
Share on other sites
If you are on a case sensitive platform you might need to include <GL/gl.h> (instead of <gl/gl.h>)

However, if you're on Windows you don't have to worry about it.

Share this post


Link to post
Share on other sites
i'm getting errors like this:

D:\Program Files\Visual Studio .Net 2003\Vc7\PlatformSDK\Include\gl\GL.h(1152): error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
D:\Program Files\Visual Studio .Net 2003\Vc7\PlatformSDK\Include\gl\GL.h(1152): error C2146: syntax error : missing ';' before identifier 'glAccum'
D:\Program Files\Visual Studio .Net 2003\Vc7\PlatformSDK\Include\gl\GL.h(1152): error C2182: 'APIENTRY' : illegal use of type 'void'
D:\Program Files\Visual Studio .Net 2003\Vc7\PlatformSDK\Include\gl\GL.h(1153): error C2144: syntax error : 'void' should be preceded by ';'
D:\Program Files\Visual Studio .Net 2003\Vc7\PlatformSDK\Include\gl\GL.h(1153): error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
...

Share this post


Link to post
Share on other sites
did you put
#include <windows.h>
before including gl/gl.h ?
Seems your compiler is missing those definitions of basic window stuff.

Share this post


Link to post
Share on other sites
hmm... well, how do i not need that stuff. b/c i'm trying to make my programs cross platform and i switched to opengl so i don't need windows stuff.

Share this post


Link to post
Share on other sites
OpenGL doesn't provide platform independence; it just happens to be platform independent itself. You'll need to use OpenGL with something like SDL or GLUT for full platform independence.

Share this post


Link to post
Share on other sites
#ifdef _WIN32
#influde windows
#include gl.h
#endif

#ifndef _WIN32
#include gl.h

so your code stays platform independant

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!