Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-16277

Cannot build Zabbix agent for Windows with VS2019 build tools

    XMLWordPrintable

    Details

    • Team:
      Team A
    • Sprint:
      Sprint 53 (Jun 2019), Sprint 54 (Jul 2019)
    • Story Points:
      0.5

      Description

      There are various issues when trying to build Zabbix agent with Visual Studion 2019 build tools:
      1) For 32 bit systems PROCESSOR_ARCHITECTURE is now x86 rather than i386, this seems easy to fix it:

      diff --git a/build/win32/project/Makefile_agent b/build/win32/project/Makefile_agent
      index 495661eb9b..ea6c6f54c5 100644
      --- a/build/win32/project/Makefile_agent
      +++ b/build/win32/project/Makefile_agent
      @@ -3,10 +3,9 @@
       CPU=$(PROCESSOR_ARCHITECTURE)
       !ENDIF
       
      -!IF "$(CPU)" == "i386"
      +!IF "$(CPU)" == "i386" || "$(CPU)" == "x86" 
       TARGETDIR = ..\..\..\bin\win32
       ADD_LFLAGS = /MACHINE:X86
      -
       !ELSEIF "$(CPU)" == "AMD64"
       TARGETDIR = ..\..\..\bin\win64
       ADD_LFLAGS = /MACHINE:X64
      

      2) Conflicts between structures that were defined to support some features on older systems and the new build environment:

      Microsoft (R) Program Maintenance Utility Version 14.21.27702.2
      Copyright (C) Microsoft Corporation.  All rights reserved.
      
              cl.exe ..\..\..\src\zabbix_agent\logfiles.c /Fo"..\..\..\src\zabbix_agent\logfiles.o" /I ..\..\..\src\zabbix_agent /I .\ /I ..\include /I ..\..\..\incl
      de"  /D WITH_AGENT_METRICS /D WITH_COMMON_METRICS  /D WITH_SPECIFIC_METRICS /D WITH_HOSTNAME_METRIC /D WITH_SIMPLE_METRICS  /Zi /D DEFAULT_CONFIG_FILE="\"C:\\z
       /Fdzabbix_agentd.exe.pdb  /nologo /O2 /Ob1 /GF /FD /EHsc /MT /Gy /W3 /c /D _WINDOWS /D _CONSOLE /D UNICODE  /D _UNICODE /D HAVE_WINLDAP_H /D HAVE_ASSERT_H /D
      C80_UPGRADE=0x0600" /D HAVE_IPV6 /TC /DPCRE_STATIC
      logfiles.c
      G:\feature\ZBX-15827-4.2\include\symbols.h(29): error C2365: 'FileIdInfo': redefinition; previous definition was 'enumerator'
      C:\Program Files\Windows Kits\8.1\include\um\minwinbase.h(190): note: see declaration of 'FileIdInfo'
      G:\feature\ZBX-15827-4.2\include\symbols.h(29): error C2086: 'FileIdInfo': redefinition
      G:\feature\ZBX-15827-4.2\include\symbols.h(28): note: see declaration of 'FileIdInfo'
      G:\feature\ZBX-15827-4.2\include\symbols.h(41): error C2371: 'FILE_ID_INFO': redefinition; different basic types
      C:\Program Files\Windows Kits\8.1\include\um\winbase.h(8342): note: see declaration of 'FILE_ID_INFO'
      ..\..\..\src\zabbix_agent\logfiles.c(349): error C2039: 'LowPart': is not a member of '_FILE_ID_128'
      C:\Program Files\Windows Kits\8.1\include\um\winnt.h(12321): note: see declaration of '_FILE_ID_128'
      ..\..\..\src\zabbix_agent\logfiles.c(350): error C2039: 'HighPart': is not a member of '_FILE_ID_128'
      C:\Program Files\Windows Kits\8.1\include\um\winnt.h(12321): note: see declaration of '_FILE_ID_128'
      

      Here solution could be to prefix the redefined structures, enums with ZBX/Zbx. That way there will be no conflicts and GetFileInformationByHandleEx is loaded dynamically, so there will be no errors as long as the structure compatibility is kept.

        Attachments

          Activity

            People

            Assignee:
            MVekslers Michael Veksler
            Reporter:
            wiper Andris Zeila
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: