Welcome, Guest. Please login or register.

Author Topic: ANSI C++ forbids declaration `res' with no type  (Read 3756 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Fab12

  • Newbie
  • *
  • Join Date: Sep 2006
  • Posts: 37
    • Show all replies
Re: ANSI C++ forbids declaration `res' with no type
« on: April 29, 2009, 03:08:07 AM »
Easy one. C++ is much more strict about types and doesn't allow implicit casting to (void *).
As DoMethod() expect "Object *" as object, either define your MUI objects as Object * instead of APTR, or cast them to (Object*) in DoMethod() call.

Having compiled mui classes for OWB-MorphOS in C++, I can safely say casts are the main difference to C. Can't remember any other issue so far.
 

Offline Fab12

  • Newbie
  • *
  • Join Date: Sep 2006
  • Posts: 37
    • Show all replies
Re: ANSI C++ forbids declaration `res' with no type
« Reply #1 on: May 03, 2009, 04:39:54 PM »
It's actually quite straightforward, and gcc -E is a good friend for that. :)