CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2009
    Posts
    6

    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.

  2. #2
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    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?
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

  3. #3
    Join Date
    Dec 2009
    Posts
    6

    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.

  4. #4
    Join Date
    Aug 2000
    Location
    New York, NY, USA
    Posts
    5,656

    Re: Unknown Character "0xf"

    Quote Originally Posted by Lvl80RetPaladin View Post
    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...

  5. #5
    Join Date
    Dec 2009
    Posts
    6

    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?

  6. #6
    Join Date
    Aug 2000
    Location
    New York, NY, USA
    Posts
    5,656

    Re: Unknown Character "0xf"

    Quote Originally Posted by Lvl80RetPaladin View Post
    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.
    Quote Originally Posted by Lvl80RetPaladin View Post
    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
  •  





Click Here to Expand Forum to Full Width

Featured