CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Join Date
    Sep 2011
    Posts
    25

    Freeglut problems.

    Hi im using freeglut 2.6.0 and i cant find the .lib files. Could you help me.

  2. #2
    Join Date
    Aug 2000
    Location
    West Virginia
    Posts
    7,721

    Re: Freeglut problems.

    You can download the source at:

    [urlhttp://freeglut.sourceforge.net/index.php#download[/url]

    Then you build the libraries. The Windows workspace worked with no
    changes using VC++ 2010.

    I would guess that the Linux version would also build without problems,
    but I can not test it right now.

  3. #3
    Join Date
    Sep 2011
    Posts
    25

    Re: Freeglut problems.

    so i don't need lib files? The only reason i wanted them is because the tutorial i was using said to use them. But it is an older tutorial so maybe i dont need them anymore.

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

    Re: Freeglut problems.

    You need them. What Philip said was that you can download the source and build them yourself.
    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

  5. #5
    Join Date
    Sep 2011
    Posts
    25

    Re: Freeglut problems.

    But how do I build it myself? I don't know how to build things.

  6. #6
    Join Date
    Aug 2000
    Location
    West Virginia
    Posts
    7,721

    Re: Freeglut problems.

    What operating system and compiler are you using ?

  7. #7
    Join Date
    Sep 2011
    Posts
    25

    Re: Freeglut problems.

    Im using windows vista and visual c++ 2010.

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

    Re: Freeglut problems.

    I downloaded the 2.6.0 package from the page Philip gave. The package contains a VC2008 sln, in VisualStudio2008 for a dll and in VisualStudio2008static for lib. Just open the sln you want, let VC2010 convert the project and then press F7 to build it.
    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

  9. #9
    Join Date
    Sep 2011
    Posts
    25

    Re: Freeglut problems.

    Ok so i have it built and running fine but I have another problem. I have a simple program that creates a window, but if I add mouse click detection it causes and error.

    Program:

    Code:
    #include <GL/glew.h> // Include the GLEW header file   
    #include <GL/glut.h> // Include the GLUT header file   
      
    void display (void) 
    {   
    glClearColor(1.0f, 0.0f, 0.0f, 1.0f); // Clear the background of our window to red   
    glClear(GL_COLOR_BUFFER_BIT); //Clear the colour buffer (more buffers later on)   
    glLoadIdentity(); // Load the Identity Matrix to reset our drawing locations   
    glFlush(); // Flush the OpenGL buffers to the window   
    }   
      
    void reshape (int width, int height) 
    {   
    glViewport(0, 0, (GLsizei)width, (GLsizei)height); // Set our viewport to the size of our window   
    glMatrixMode(GL_PROJECTION); // Switch to the projection matrix so that we can manipulate how our scene is viewed   
    glLoadIdentity(); // Reset the projection matrix to the identity matrix so that we don't get any artifacts (cleaning up)   
    gluPerspective(60, (GLfloat)width / (GLfloat)height, 1.0, 100.0); // Set the Field of view angle (in degrees), the aspect ratio of our window, and the new and far planes   
    glMatrixMode(GL_MODELVIEW); // Switch back to the model view matrix, so that we can start drawing shapes correctly   
    }   
    
    void keyPressed (unsigned char key, int x, int y) 
    {
    
    } 
    
    void keyUp (unsigned char key, int x, int y) 
    {
    
    } 
    
    int main (int argc, char **argv) 
    {     
    glutKeyboardFunc(keyPressed); // Tell GLUT to use the method "keyPressed" for key presses
    glutKeyboardUpFunc(keyUp); // Tell GLUT to use the method "keyUp" for key up events  	
    glutInit(&argc, argv); // Initialize GLUT   
    glutInitDisplayMode (GLUT_SINGLE); // Set up a basic display buffer (only single buffered for now)   
    glutInitWindowSize (800, 600); // Set the width and height of the window   
    glutInitWindowPosition (100, 100); // Set the position of the window   
    glutCreateWindow ("Biolife"); // Set the title for the window   
    glutDisplayFunc(display); // Tell GLUT to use the method "display" for rendering   
    glutReshapeFunc(reshape); // Tell GLUT to use the method "reshape" for rendering   
    glutMainLoop(); // Enter GLUT's main loop   
    }
    But if I take the mouse click detection out it doesn't have the errors.

    Error Log:

    Code:
    'Biolife.exe': Loaded 'C:\Program Files\Biolife\Debug\Biolife.exe', Symbols loaded.
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\ntdll.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\kernel32.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\freeglut.dll', Symbols loaded.
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\user32.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\gdi32.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\advapi32.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\rpcrt4.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\opengl32.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\msvcrt.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\glu32.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\ddraw.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\dciman32.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\setupapi.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\oleaut32.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\ole32.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\dwmapi.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\winmm.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\oleacc.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\msvcr100d.dll', Symbols loaded.
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\shimeng.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\apphelp.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\AppPatch\AcLayers.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\shell32.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\shlwapi.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\userenv.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\secur32.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\winspool.drv', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\mpr.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\imm32.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\msctf.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\lpk.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\System32\usp10.dll', Cannot find or open the PDB file
    'Biolife.exe': Loaded 'C:\WINDOWS\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll', Cannot find or open the PDB file
    The program '[3816] Biolife.exe: Native' has exited with code 1 (0x1).
    Can anyone help me fix this? Thanks in ahead
    Also thanks for the help Philip and S M A.
    Last edited by HavingPhun; October 28th, 2011 at 06:08 AM.

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

    Re: Freeglut problems.

    If you by code thing means code tags you did almost get those right. They should be [code]Code here[/code]. Additional formatting tags can be found here http://www.codeguru.com/forum/misc.php?do=bbcode#code

    I've never worked with glut but shouldn't glutInit be the very first call? Are there any other calls that should be made in another order?
    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

  11. #11
    Join Date
    Sep 2011
    Posts
    25

    Re: Freeglut problems.

    Ok well i am new to glut, but i only encounter this problem when i add mouse click detection so i don't know why this is happening.

  12. #12
    Join Date
    Aug 2000
    Location
    West Virginia
    Posts
    7,721

    Re: Freeglut problems.

    Did you move the call to glutKeyboardFunc() to after glutInit()
    as suggested by S_M_A ?

    Also, that does not catch match clicks. To process mouse clicks use
    glutMouseFunc()

  13. #13
    Join Date
    Sep 2011
    Posts
    25

    Re: Freeglut problems.

    ok ill try that.

  14. #14
    Join Date
    Sep 2011
    Posts
    25

    Re: Freeglut problems.

    Can you give me an example of how to use glutMouseFunc() and the arguments it requires?

  15. #15
    Join Date
    Sep 2011
    Posts
    25

    Re: Freeglut problems.

    It works now. Just had to put glutInit() before everything else like you said.

Page 1 of 2 12 LastLast

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