PRB: "Error 53 error in declarator" in MPW 3.3.1

Last reviewed: June 4, 1996
Article ID: Q130241
The information in this article applies to:
  • Microsoft FoxPro for Macintosh, version 2.6a

SYMPTOMS

When building an LCK Library for FoxPro for Macintosh, using the Macintosh Programmer's Workbench (MPW) version 3.3.1, you may get the error message "Error 53 error in declarator" during the compile phase.

What you actually see on your screen in the MPW 3.3.1 Worksheet window looks something like this:

        Compiling Myprogram.c
   #void 0xA029
   #          ?
   ### Error 53 error in declarator
   #          ?
   ### Error 247 Huh ?

There will probably be more information, but the information shown above illustrates what you should expect to see.

CAUSE

This compilation error is due to a conflict between certain FoxPro API function names and the system header file (Traps.h) provided by Apple. The FoxPro API function names that conflict with Apple's Traps.h file are:

   _GlobalToLocal
   _FindWindow
   _NewMenu
   _DisposeMenu
   _GetNextEvent
   _HLock

MPW 3.3.1 is apparently trying to replace the calls to these functions with the #define definitions found in the Traps.h file. The example error message illustrated above points to the line containing "void 0xA029" because the C program being compiled had a reference to the FoxPro API function _Hlock(), which MPW 3.3.1 confused with the following line in the Traps.h file:

   #define _HLock 0xA029

WORKAROUND

Here is a list of the #define commands excerpted from the Traps.h file that cause conflicts with the use of corresponding FoxPro API functions:

   /*
       ; QuickDraw
   */
   #define _GlobalToLocal 0xA871
   /*
       ; Toolbox
   */
   #define _FindWindow 0xA92C
   #define _NewMenu 0xA931
   #define _DisposeMenu 0xA932
   #define _GetNextEvent 0xA970
   /*
       ; Memory Manager
   */
   #define _HLock 0xA029

To correct the problem, run MPW 3.3.1 and edit the Traps.h file. You'll find it under the folder "MPW Folder:Interfaces:CIncludes." Change the
#define commands listed above into comment lines. Save the Traps.h file,
and re-compile your LCK program. The error should not occur.

STATUS

Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

When compiling other C programs for the Macintosh and using MPW 3.3.1, use the original copy of the Traps.h file that does not have any #define statements changed to commented. It might be best to keep two copies of the Traps.h file: one for use when building FoxPro API Libraries, and one for use when building Macintosh programs.

NOTE: Macintosh Programmer's Workbench does not come with the Macintosh operating system but can be obtained from the Apple Programmers and Developers Association (APDA) at (800) 282-2732.

NOTE: Some products mentioned in this article are manufactured by vendors independent of Microsoft; we make no warranty, implied or otherwise, regarding these products' performance or reliability.


Additional reference words: FoxMac 2.60a
KBCategory: kbtool kbprb kb3rdparty
KBSubcategory: FxtoolLck


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 4, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.