Ad Widget

Collapse

zabbix-6.4.21 agent2 compile error on windows

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hexbug
    Junior Member
    • Nov 2024
    • 6

    #1

    zabbix-6.4.21 agent2 compile error on windows

    After running
    Code:
    mingw32-make PCRE2=C:\temp\pcre2 OPENSSL=C:\temp\openssl
    ,it shows
    Code:
    C:/temp/pg/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.5.0/../../../../x86_64-w64-mingw32/bin/ld.exe: c:/temp/openssl32\\lib/libcrypto.a(libdefault-lib-winstore_store.obj):winstore_store:(.text+0x63): undefined reference to `__imp_CertFreeCertificateContext'
    C:/temp/pg/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.5.0/../../../../x86_64-w64-mingw32/bin/ld.exe: c:/temp/openssl32\\lib/libcrypto.a(libdefault-lib-winstore_store.obj):winstore_store:(.text+0x7e): undefined reference to `__imp_CertCloseStore'
    C:/temp/pg/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.5.0/../../../../x86_64-w64-mingw32/bin/ld.exe: c:/temp/openssl32\\lib/libcrypto.a(libdefault-lib-winstore_store.obj):winstore_store:(.text+0x12f): undefined reference to `__imp_CertOpenSystemStoreW'
    C:/temp/pg/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.5.0/../../../../x86_64-w64-mingw32/bin/ld.exe: c:/temp/openssl32\\lib/libcrypto.a(libdefault-lib-winstore_store.obj):winstore_store:(.text+0x147): undefined reference to `__imp_CertFreeCertificateContext'
    C:/temp/pg/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.5.0/../../../../x86_64-w64-mingw32/bin/ld.exe: c:/temp/openssl32\\lib/libcrypto.a(libdefault-lib-winstore_store.obj):winstore_store:(.text+0x374): undefined reference to `__imp_CertFindCertificateInStore'
    C:/temp/pg/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.5.0/../../../../x86_64-w64-mingw32/bin/ld.exe: c:/temp/openssl32\\lib/libcrypto.a(libdefault-lib-winstore_store.obj):winstore_store:(.text+0x5cb): undefined reference to `__imp_CertFreeCertificateContext'
    C:/temp/pg/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.5.0/../../../../x86_64-w64-mingw32/bin/ld.exe: c:/temp/openssl32\\lib/libcrypto.a(libdefault-lib-winstore_store.obj):winstore_store:(.text+0x667): undefined reference to `__imp_CertFindCertificateInStore'
    collect2.exe: error: ld returned 1 exit status
    solution:
    Add -lcrypt32 to zabbix-6.4.21\src\go\pkg\tls\tls.go: line25
    Code:
    -#cgo openssl LDFLAGS: -lssl -lcrypto -lwsock32 -lws2_32
    +#cgo openssl LDFLAGS: -lssl -lcrypto -lwsock32 -lws2_32 -lcrypt32
Working...