Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Problem with converting my code from C to C++

  1. #1
    Newbie Newbie
    Join Date
    Oct 2013
    Posts
    3

    Problem with converting my code from C to C++

    I'm pretty new to this. I've been using MinGW and Msys, I have been successfully creating programs in C but when I try to convert it over to C++ I get all sorts of problems. One, it wont recognize my glutTimerFunc as valid and tells me my glOrtho has too many arguments even though it doesn't. Any help would be appreciated.

  2. #2
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    495
    Quote Originally Posted by Dan_182 View Post
    I'm pretty new to this. I've been using MinGW and Msys, I have been successfully creating programs in C but when I try to convert it over to C++ I get all sorts of problems. One, it wont recognize my glutTimerFunc as valid
    Ensure that the function is actually a function (not a method) and has C linkage.
    Quote Originally Posted by Dan_182 View Post
    and tells me my glOrtho has too many arguments even though it doesn't.
    Post the actual code, along with the actual error message.

  3. #3
    Newbie Newbie
    Join Date
    Oct 2013
    Posts
    3
    Thanks! It was an animation method not a function. But now that brings up another question (if you know the answer), why is it when I compiled the program in C it didn't care whether it was a function or not but in C++ it does even if I don't use the value that was passed into it?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •