Jump to content
  • Advertisement
Sign in to follow this  
Kaidan Alenko

Invalid or corrupt .h file?

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

I'm building a source code of mine in which I get an unresolved external symbol error for each GL and GLUT function call I make; these errors happen during the Linking process. Figuring it might solve the problem, I added GL.h GLU.h and glut.h into my "Additional Dependencies" option in Microsft Visual C++ 2008. Now I'm getting the following error for all three files, with their respective names (meaning not every error says gl.h) C:\Program Files\Microsoft Visual Studio 9.0\VC\include\GLU.h : fatal error LNK1107: invalid or corrupt file: cannot read at 0x476C Do you think my files are the problem?

Share this post


Link to post
Share on other sites
Advertisement
No. Header files are not libraries -- they're header files (see here). The "additional dependencies" line is for linking to libraries.

The error you got is a linker error, which indicates that your source code compiled successfully but could not be linked into a final executable. What you want is to add the OpenGL libraries (typically opengl32.lib) to that line, not the header files.

Share this post


Link to post
Share on other sites
Is there any other opengl library I need to add to the list? That is just the thing, I have OpenGL32.lib (located in VC\lib) on that list and I continue to get the 16 unresolved external symbols.

Share this post


Link to post
Share on other sites
If you're using GLU functions you'll need to add the library for GLU. Generally it's Glu32.lib. If you're using GLUT functions, you'll need to add the library for GLUT. It's generally called glut32.lib.

Share this post


Link to post
Share on other sites
Much thanks, that resolves the unresolved externals for GLU and GLUT. Is there any other lib file I need for GL commands, along with OpenGL32.lib? GLU and GLUT errors are gone, however I'm receiving 10 errors for gl functions, for example:

OpenGLtest.obj : error LNK2019: unresolved external symbol __imp__glOrtho@48 referenced in function "void __cdecl ChangeSize(int,int)" (?ChangeSize@@YAXHH@Z)

OpenGLtest.obj : error LNK2019: unresolved external symbol __imp__glViewport@16 referenced in function "void __cdecl ChangeSize(int,int)" (?ChangeSize@@YAXHH@Z)

Share this post


Link to post
Share on other sites
Huh, I thought we went over this already. You downloaded some weird opengl-looking libraries from god-knows-where, and that's not how to go about it. Rather, all you need to do is install the latest version of the Platform SDK which includes them (available here; note that despite the name it supports all Windows versions since XP).

Share this post


Link to post
Share on other sites
Quote:
I thought we went over this already...all you need to do is install the latest version of the Platform SDK

In all fairness, Sneftel, with regard to what "we went over" in the other thread, a search for "platform sdk" or "opengl sdk" on msdn downloads doesn't return useful results. No indication of opengl support is mentioned, so determining which "platform sdk" you intended was difficult at best. The "Visual Studio 2008 SDK" (the next best guess) does not, in fact, have opengl files.

Share this post


Link to post
Share on other sites
Quote:
Original post by Buckeye
Quote:
I thought we went over this already...all you need to do is install the latest version of the Platform SDK

In all fairness, Sneftel, with regard to what "we went over" in the other thread, a search for "platform sdk" or "opengl sdk" on msdn downloads doesn't return useful results. No indication of opengl support is mentioned, so determining which "platform sdk" you intended was difficult at best. The "Visual Studio 2008 SDK" (the next best guess) does not, in fact, have opengl files.
But in the other thread on the 18th:
Quote:
Original post by Kaidan Alenko
Indeed, we are talking about the Windows Platform SDK.
So it seems he figured out what he needed despite his using out-of-date terminology. Also, if you search for just "platform sdk" the third link provides a detailed listing of the different SDKs with a link to the download page. I do concede there might be an issue if you don't believe that the 'platform sdk' contains opengl related things. The SDKs contain a lot of stuff and it isn't always easy to find out if the thing you want is actually in it.

Share this post


Link to post
Share on other sites
The other thread didn't fix my problem. I already have the OpenGL32.lib file from the Windows Platform SDK. That is the one I am using to link. SiCrane's advice has fixed 6 of my error messages. I know you're probably irritated I'm asking about it again, I don't appreciate the berating I feel I'm getting.

Back to my unanswered question, is there any other .lib files I'll need to add aside from OpenGL32.lib, GLU.lib, and glut.lib in order for OpenGL to work? There has to be, I'm still getting error messages even with OpenGL32.lib linked.

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!