News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Compiler errors

Started by Magnum, November 19, 2012, 11:13:51 AM

Previous topic - Next topic

Magnum

I know this is a C forum, but thought maybe someone could help me.

What is frustrating is that there are multiple instances of header files available and the author doesn't show what version is needed.

This are the errors I am getting from this source.
Can someone help me with this ?

Thanks,
            Andy
c:\devc++\dev-cpp\mingw32\include\comutil.h        In file included from c:\devc++\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.0/../../../../include/comutil.h
c:\devc++\dev-cpp\mingw32\include\comdef.h                         from c:\devc++\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.0/../../../../include/comdef.h
c:\devc++\dev-cpp\mingw32\include\SynWraps.h                         from c:\devc++\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.0/../../../../include/SynWraps.h
c:\devc++\dev-cpp\mingw32\include\SynKit.h                         from c:\devc++\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.0/../../../../include/SynKit.h
C:\DevC++\Dev-Cpp\Examples\Disabler\Disabler.cpp                         from C:\DevC++\Dev-Cpp\Examples\Disabler\Disabler.cpp
c:\devc++\dev-cpp\mingw32\include\intsafe.h        [Error] invalid suffix "ui64" on integer constant
c:\devc++\dev-cpp\mingw32\include\intsafe.h        [Error] invalid suffix "ui64" on integer constant
c:\devc++\dev-cpp\mingw32\include\intsafe.h        [Error] invalid suffix "ui64" on integer constant
c:\devc++\dev-cpp\mingw32\include\intsafe.h        [Error] invalid suffix "i64" on integer constant
c:\devc++\dev-cpp\mingw32\include\intsafe.h        [Error] invalid suffix "i64" on integer constant
c:\devc++\dev-cpp\mingw32\include\intsafe.h        [Error] invalid suffix "ui64" on integer constant
c:\devc++\dev-cpp\mingw32\include\intsafe.h        [Error] invalid suffix "ui64" on integer constant
c:\devc++\dev-cpp\mingw32\include\intsafe.h        [Error] invalid suffix "ui64" on integer constant
c:\devc++\dev-cpp\mingw32\include\SynKit.h                         from c:\devc++\dev-cpp\mingw32\bin\../lib/gcc/mingw32/4.7.0/../../../../include/SynKit.h
C:\DevC++\Dev-Cpp\Examples\Disabler\Disabler.cpp                         from C:\DevC++\Dev-Cpp\Examples\Disabler\Disabler.cpp
c:\devc++\dev-cpp\mingw32\include\comdef.h        comip.h: No such file or directory.


// Disabler.cpp : Defines the entry point for the console application.
//

#include <stdio.h>

// All programs using the Synaptics COM SDK include SynKit.h
#include "SynKit.h"

enum eAction {eNone = -1,
  eDisableStick = 0x000,
  eEnableStick = 0x001,
  eDisableTouchPad = 0x100,
  eEnableTouchPad = 0x101,
  eDisableStickButtons = 0x010,
  eEnableStickButtons = 0x011,
  eDisableTouchPadButtons = 0x110,
  eEnableTouchPadButtons = 0x111,
  eDisablePressToSelect = 0x020,
  eEnablePressToSelect = 0x021,
  eDisableTaps = 0x120,
  eEnableTaps = 0x121,
  eWaitForStickButton = 0x030,
  eWaitForTouchPadButton = 0x130
};

enum eAction ParseCommandLine(int argc, char* argv[])
{
  if (argc != 2)
    return eNone;
  else if(!stricmp(argv[1], "DisableStick"))
    return eDisableStick;
  else if(!stricmp(argv[1], "EnableStick"))
    return eEnableStick;
  else if(!stricmp(argv[1], "DisableTouchPad"))
    return eDisableTouchPad;
  else if(!stricmp(argv[1], "EnableTouchPad"))
    return eEnableTouchPad;
  else if(!stricmp(argv[1], "DisableStickButtons"))
    return eDisableStickButtons;
  else if(!stricmp(argv[1], "EnableStickButtons"))
    return eEnableStickButtons;
  else if(!stricmp(argv[1], "DisableTouchPadButtons"))
    return eDisableTouchPadButtons;
  else if(!stricmp(argv[1], "EnableTouchPadButtons"))
    return eEnableTouchPadButtons;
  else if(!stricmp(argv[1], "DisablePressToSelect"))
    return eDisablePressToSelect;
  else if(!stricmp(argv[1], "EnablePressToSelect"))
    return eEnablePressToSelect;
  else if(!stricmp(argv[1], "DisableTaps"))
    return eDisableTaps;
  else if(!stricmp(argv[1], "EnableTaps"))
    return eEnableTaps;
  else if(!stricmp(argv[1], "WaitForStickButton"))
    return eWaitForStickButton;
  else if(!stricmp(argv[1], "WaitForTouchPadButton"))
    return eWaitForTouchPadButton;
  else
    return eNone;
};

int main(int argc, char* argv[])
{
  ISynAPI *pAPI = 0;

  if (CoInitialize(0) ||
    CoCreateInstance(_uuidof(SynAPI), 0,
    CLSCTX_INPROC_SERVER, _uuidof(ISynAPI), (void **) &pAPI) ||
    pAPI->Initialize())
  {
    printf("Could not obtain a Synaptics API object.\n");
    exit(-1);
  }

  int iAction = ParseCommandLine(argc, argv);
  if (iAction == eNone)
  {
    printf("Failed to parse a command.\n");
    exit(-1);
  }

  ISynDevice *pDevice = 0;
  if (iAction & 0x100)
  {
    long lHandle = -1;
    if (pAPI->FindDevice(SE_ConnectionAny, SE_DeviceTouchPad, &lHandle) ||
      pAPI->CreateDevice(lHandle, &pDevice))
    {
      printf("Unable to find a Synaptics TouchPad.\n");
      exit(-1);
    }
  }
  else
  {
    long lHandle = -1;
    if (pAPI->FindDevice(SE_ConnectionAny, SE_DeviceIBMCompatibleStick, &lHandle) ||
      pAPI->CreateDevice(lHandle, &pDevice))
    {
      printf("Unable to find an IBM compatible stick.\n");
      exit(-1);
    }
  }

  switch (iAction)
  {
  case eDisableStick:
  case eDisableTouchPad:
    pDevice->SetProperty(SP_DisableState, 1);
    break;
  case eEnableStick:
  case eEnableTouchPad:
    pDevice->SetProperty(SP_DisableState, 0);
    break;
  case eDisableStickButtons:
  case eDisableTouchPadButtons:
    {
      long lMask;
      pDevice->GetProperty(SP_LeftButtonAction, &lMask);
      lMask &= ~SF_ActionPrimary;
      pDevice->SetProperty(SP_LeftButtonAction, lMask);

      pDevice->GetProperty(SP_RightButtonAction, &lMask);
      lMask &= ~SF_ActionSecondary;
      pDevice->SetProperty(SP_LeftButtonAction, lMask);
    }
    break;
  case eEnableStickButtons:
  case eEnableTouchPadButtons:
    {
      long lMask;
      pDevice->GetProperty(SP_LeftButtonAction, &lMask);
      lMask |= SF_ActionPrimary;
      pDevice->SetProperty(SP_LeftButtonAction, lMask);

      pDevice->GetProperty(SP_RightButtonAction, &lMask);
      lMask |= SF_ActionSecondary;
      pDevice->SetProperty(SP_LeftButtonAction, lMask);
    }
    break;
  case eDisablePressToSelect:
  case eDisableTaps:
    {
      long lMask;
      pDevice->GetProperty(SP_Gestures, &lMask);
      lMask &= ~SF_GestureTap;
      pDevice->SetProperty(SP_Gestures, lMask);
    }
    break;
  case eEnablePressToSelect:
  case eEnableTaps:
    {
      long lMask;
      pDevice->GetProperty(SP_Gestures, &lMask);
      lMask |= SF_GestureTap;
      pDevice->SetProperty(SP_Gestures, lMask);
    }
    break;
  case eWaitForStickButton:
  case eWaitForTouchPadButton:
    {
      HANDLE hEvent = CreateEvent(0, 0, 0, 0);
      pDevice->SetEventNotification(hEvent);

      for ( ; ; )
      {
        WaitForSingleObject(hEvent, INFINITE);

        SynPacket Packet;
        pDevice->LoadPacket(Packet);

        if (Packet.ButtonState())
        {
          exit(0);
        }
      }
    }
    break;
  default:
    break;
  };

  return 0;
}

Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

Vortex

Hi Magnum,

QuoteI know this is a C forum, but thought maybe someone could help me.

Sorry but this is the Poasm subforum.