Menu

Problems compiling a C++ header file

Anonymous
2002-08-08
2012-09-26
  • Anonymous

    Anonymous - 2002-08-08

    To all experienced C++ programmers...Help

    For my University project I am using the include header file "mouse.h" that is freely available from "Mouse++ Version 4.0" by Carl Moreland. The code I have written compiles ok but I keep on getting the same error messages from mouse.h. With my limited experience I have not been able to fix the problems. Your help would be appreciated.

    I have tried 2 different compilers but both throw up errors from mouse.h on the same lines. I am sure that with your coding experience you will immediately spot how to cure the problems, I have copied the errors and shown them below together with code snippets, it would seem to me that a cure for line 53 will be a cure for all.

    Regards Tom Roberts.

    p.s. I shall be at my present address for another 2 weeks so please reply soonest.

    DEV-C++ = Bloodshed DEV-C++ V4.9.4.1Compiler
    BCC32 = Borland C++ 5.5.1 for Win32 Compiler
    FILE = MOUSE.H

    LINE       CODE

    52          class Mouse;
    53          void far interrupt MouseHandler(void);

    DEV-C++ syntax error before `MouseHandler'
    BCC32 Error E2449 - Size of 'far' is unknown or zero
    BCC32 Error E2141 - Declaration syntax error

    140          MouseEventHandler(void);
    141          MouseEventHandler(unsigned char mask,
    142          void interrupt (*handler)(void) = MouseHandler);

    BCC32 Error E2040 - Declaration terminated incorrectly
    DEV-C++ `handler' was not declared in this scope
    DEV-C++ function `void interrupt()' is initialized like a variable

    258          void InstallHandler(void);
    259          void InstallHandler(unsigned char mask,
    260 void interrupt (*handler)(void) = MouseHandler);

    DEV-C++ `handler' was not declared in this scope
    DEV-C++ function `void interrupt()' is initialized like a variable
    BCC32 Error E2091 - Functions cannot return arrays or functions
    BCC32 Error E2451 - Undefined
    symbol 'MouseHandler'

     
    • Nobody/Anonymous

      These "far" statements are not standard C++. They were used in old MSDOS compilers. Try to get Borland compiler 3.1 or older

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.