This section demonstrates how to build Zabbix agent 2 (Windows) from sources.
1. Download MinGW-w64 with SJLJ (set jump/long jump) Exception Handling and Windows threads (for example x86_64-8.1.0-release-win32-sjlj-rt_v6-rev0.7z)
2. Extract and move to c:\mingw
3. Setup environmental variable
When compiling use Windows prompt instead of MSYS terminal provided by MinGW
The following instructions will compile and install 64-bit PCRE libraries in c:\dev\pcre and 32-bit libraries in c:\dev\pcre32:
1. Download the PCRE or PCRE2 (supported since Zabbix 6.0) library (https://pcre.org/) and extract
2. Open cmd and navigate to the extracted sources
1. Delete old configuration/cache if exists:
2. Run cmake (CMake can be installed from https://cmake.org/download/):
cmake -G "MinGW Makefiles" -DCMAKE_C_COMPILER=gcc -DCMAKE_C_FLAGS="-O2 -g" -DCMAKE_CXX_FLAGS="-O2 -g" -DCMAKE_INSTALL_PREFIX=c:\dev\pcre
3. Next, run:
1. Run:
2. Delete CMakeCache.txt:
3. Run cmake:
cmake -G "MinGW Makefiles" -DCMAKE_C_COMPILER=gcc -DCMAKE_C_FLAGS="-m32 -O2 -g" -DCMAKE_CXX_FLAGS="-m32 -O2 -g" -DCMAKE_EXE_LINKER_FLAGS="-Wl,-mi386pe" -DCMAKE_INSTALL_PREFIX=c:\dev\pcre32
4. Next, run:
If you don't have it installed already, install Cygwin and Perl for Cygwin and configure them according to instructions in the official Perl documentation.
Run:
perl Configure mingw64 no-shared no-ui-console no-tests no-capieng --libdir=lib --api=1.1.0 --prefix=c:\dev\openssl32 --openssldir=c:\dev\openssl32
make build_sw
make install_dev
Open MinGW environment (Windows command prompt) and navigate to build/mingw directory in the Zabbix source tree.
Run:
Open MinGW environment (Windows command prompt) and navigate to build/mingw directory in the Zabbix source tree.
Run:
Both 32- and 64- bit versions can be built on a 64-bit platform, but only a 32-bit version can be built on a 32-bit platform. When working on the 32-bit platform, follow the same steps as for 64-bit version on 64-bit platform.