Menu

Compilation issues upgrade to 6.40 MVC

Help
vranoch
2021-09-13
2021-09-16
  • vranoch

    vranoch - 2021-09-13

    Hi Gary,

    trying to upgrade my 6.3x based code (mixed C/C++) on MVC (Visual C++ 2017) to 6.4x CLIPS sources but I encounter bunch of compilation issues on C++ sources. Namely:

    1>d:\projects\erian\local\develop\git\libraries\komix.erian.esc.core\core\scanner.h(70): error C2365: 'TokenType': redefinition; previous definition was 'enumerator'
    1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\um\winnt.h(10650): note: see declaration of 'TokenType'
    

    on any C++ source icluding ATL (atlbase.h)

    and

    1>d:\projects\erian\local\develop\git\libraries\komix.erian.esc.core\core\rulecom.h(109): error C2733: 'GetFocus': second C linkage of overloaded function not allowed
    1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\um\winuser.h(5744): note: see declaration of 'GetFocus'
    

    Tried WIN_MVC precompiler setting and without it but with no luck. Could You advice any other setting that could cause this issue?

    Thanks Vranoch

     
    • Gary Riley

      Gary Riley - 2021-09-14

      There isn't a setting that will resolve name conflicts among the header files. Since you have the CLIPS source code, the easiest resolution is to just rename any conflicting definitions there. Alternatively, you would need to place the code requiring atlbase.h and winuser.h in a separate file that does not include the clips headers.

       
  • vranoch

    vranoch - 2021-09-16

    finally ...

    #define TokenType _TokenType
    #define GetFocus _GetFocus
    #include "windows.h"
    

    ... the purpose sanctifies the means ;-)

     

Log in to post a comment.