Results 1 to 4 of 4

Thread: I am trying to compile an example openGL program

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2003
    Location
    Australia
    Posts
    2

    I am trying to compile an example openGL program

    Hi,

    I am trying to compile an example openGL program from SUN web site: http://www.sgi.com/software/opengl/e...source/mouse.c

    using VusualStudio 6.0. I am having trouble with compiling this example. Could anyone help me?

    Thanks

  2. #2
    Member Newbie
    Join Date
    Aug 2003
    Location
    asda
    Posts
    47

    Re: I am trying to compile an example openGL program

    You should post the error messages you got.
    asd

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2003
    Location
    Australia
    Posts
    2

    Re: I am trying to compile an example openGL program

    Originally posted by Some guy:
    You should post the error messages you got.
    -------------------Configuration: mouse - Win32 Debug--------------------
    Compiling...
    StdAfx.cpp
    Compiling...
    mouse.cpp
    D:\Program Files\Microsoft Visual Studio\MyProjects\mouse\mouse.cpp(262) : error C2065: 'malloc' : undeclared identifier
    D:\Program Files\Microsoft Visual Studio\MyProjects\mouse\mouse.cpp(313) : error C2065: 'free' : undeclared identifier
    D:\Program Files\Microsoft Visual Studio\MyProjects\mouse\mouse.cpp(316) : error C2664: 'ReleaseDC' : cannot convert parameter 1 from 'struct HDC__ *' to 'struct HWND__ *'
    Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    D:\Program Files\Microsoft Visual Studio\MyProjects\mouse\mouse.cpp(344) : error C2065: 'exit' : undeclared identifier
    D:\Program Files\Microsoft Visual Studio\MyProjects\mouse\mouse.cpp(365) : error C2664: 'ReleaseDC' : cannot convert parameter 1 from 'struct HDC__ *' to 'struct HWND__ *'
    Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    Error executing cl.exe.

    mouse.exe - 5 error(s), 0 warning(s)

  4. #4
    Member Newbie
    Join Date
    Aug 2003
    Location
    asda
    Posts
    47

    Re: I am trying to compile an example openGL program

    It seems that you are creating the wrong type of project in the IDE. Is not StdAfx for MFC and why is the C file now a cpp file? The type conversion errors is probably because you are using C++. Convert back to C or add proper type conversions.

    The errors about malloc, free should go away if you include stdlib.h
    asd

Similar Threads

  1. Replies: 0
    Last Post: 10-25-2013, 05:46 AM
  2. Replies: 1
    Last Post: 10-30-2002, 07:58 AM
  3. help!first GL program(compile error)
    By rage7826 in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 07-20-2002, 07:51 PM
  4. How to compile OpenGL program on Linux?
    By in forum OpenGL: Linux
    Replies: 2
    Last Post: 07-13-2002, 08:19 PM
  5. Missing lib for program using glut to compile
    By VenTure in forum OpenGL: Linux
    Replies: 4
    Last Post: 02-13-2001, 10:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean