|
-
January 28th, 2010, 07:39 PM
#1
Unknown Character "0xf"
I'm getting multiple error messages like the thread title when trying to compile an example from the OpenGL Superbible on my Visual C++ 2008. Due to the fact that the code isn't mine (it's a book example) I'm not going to post it on this site.
Apparently the problem is with my OpenGL32.lib file. At first I was getting the "unresolved external symbol" or something like that, so I linked the lib directory as an additional dependency and now I am getting 21 errors like this:
C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\opengl32.lib(3) : error C2018: unknown character '0x1'
C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\opengl32.lib(3) : error C2018: unknown character '0x3'
C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\opengl32.lib(3) : error C2018: unknown character '0xf'
C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\opengl32.lib(3) : error C2018: unknown character '0x1'
What do you think the problem is and how can I fix it? Maybe my IDE isn't set up correctly.. Do I need the files wglext.h and glext.h to run OpenGL? I don't have those in yet.
-
January 29th, 2010, 04:50 AM
#2
Re: Unknown Character "0xf"
Seems like the lib for some reason is read as text. Are you sure you added it to be linked and not to be compiled?
-
January 29th, 2010, 05:23 PM
#3
Re: Unknown Character "0xf"
That could be it. What I did to link it was
Project -> (Project name) Properties -> Linker -> General
then copied the file path of the directory with all of the libs in it into the "Additional Library directories" slot, which is
C:\Program Files\Microsoft Visual Studio 9.0\VC\lib
Do you think I linked it wrong?
Edit - also I'm not sure if this is important or not, but I noticed at the top of the list of the 21 errors there is this error:
C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\opengl32.lib(1) : error C2059: syntax error : '<'
From my programming experience the top error is what should be explored first; however seeing as how the error comes from within Opengl32.lib, I'm not sure how to advance.
Last edited by Lvl80RetPaladin; January 29th, 2010 at 05:26 PM.
-
January 30th, 2010, 01:06 PM
#4
Re: Unknown Character "0xf"
 Originally Posted by Lvl80RetPaladin
Do you think I linked it wrong?
Hard to say - you are not linking anything yet.
What you posted are compiler errors; you fail to compile your code.
Could it be that you "include" that lib file?
Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
Convenience and productivity tools for Microsoft Visual Studio:
FeinWindows - replacement windows manager for Visual Studio, and more...
-
January 31st, 2010, 09:37 PM
#5
Re: Unknown Character "0xf"
Sorry for the late reply.
Indeed, that's what I'm doing. I have #include <Opengl32.lib> in my source code. However if I get rid of it I receive ~16 errors of "unresolved external symbol", which I've heard is because Opengl32.lib is not being linked. For example I'm getting
Source1.obj : error LNK2001: unresolved external symbol _glLoadIdentity
What do you mean I am not linking anything yet?
-
February 1st, 2010, 09:23 PM
#6
Re: Unknown Character "0xf"
 Originally Posted by Lvl80RetPaladin
Indeed, that's what I'm doing. I have #include <Opengl32.lib> in my source code. However if I get rid of it I receive ~16 errors of "unresolved external symbol", which I've heard is because Opengl32.lib is not being linked. For example I'm getting
Source1.obj : error LNK2001: unresolved external symbol _glLoadIdentity
Well, your including of a lib file doesn’t really fix your original 16 errors; it simply creates one error that causes termination of farther compilation.
If your only goal is to reduce the number of error – this is it. You are practically guaranteed to not see any more errors in that project.
 Originally Posted by Lvl80RetPaladin
What do you mean I am not linking anything yet?
Producing an executable file from your code requires (at least) two steps: compile source code into object files and link object files. If compiler fails – you don’t get to link.
Your “unresolved external” errors are in fact linker errors that should be fixed, as you’ve heard, by linking with that lib file.
Read the documentation of you linker on how to do that properly.
Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
Convenience and productivity tools for Microsoft Visual Studio:
FeinWindows - replacement windows manager for Visual Studio, and more...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|