Article # 122, added by Geoworks, historical record
| first | previous | index | next | last |

Using the SDK with Borland C++ 5.0.



When using BC 5.0 you must have an even number of methods defined for
your classes. This is because the #pragma option -a is broken in Borland
C++. It hasn't been fixed even in the 5.02 release of Borland C++. GOC
uses this pragma to word align the class structures. Since it is not
working now, you'll have to maintain an even number of methods for each
class you define in your source code. This can be as simple as defining
a dummy method, like this:

@method MyClass, MSG_META_INITIALIZE
{

    @callsuper();
}

Even if the message is never sent to that class, the point is that
you've reserved space for it in the class structure, making the
class structure an even number of bytes long.

This error only shows up if you have more than one class declared, as
in this case:

@classdecl FirstClass;  /* Has an odd number of methods. */
@classdecl SecondClass; /* This class will be messed up, as
                         * well as any subsequent classes. */

There could also be a problem with defining odd-sized global variables.
It could hose the word alignment for the class table, and the tools
wouldn't be able to do anything about it. For example:

  char myHosingArray[3] = { 'a', 'b', 'c' };

  @classdecl MyHosedClass;