1

我正在遵循Building The Library指南,但我有错误。我的脚步。

1.使用 . 设置 x64 环境vcvars64.bat

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat

2.运行configure.py

python "C:\Users\Megam\Downloads\Botan-2.10.0\Botan-2.10.0\configure.py" --cc=msvc --cpu=x64 --os=windows

3.运行 nmake。

'stddef.h': No such file or directory

这是我的 cmd.exe 输出。

Microsoft Windows [Versión 10.0.17134.407]
(c) 2018 Microsoft Corporation. Todos los derechos reservados.

C:\Users\Megam>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.9.7
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'

C:\Users\Megam>python "C:\Users\Megam\Downloads\Botan-2.10.0\Botan-2.10.0\configure.py" --cc=msvc --cpu=x64 --os=windows
   INFO: Configuring to build Botan 2.10.0 (revision git:3a459487df5de4cb411efdda0010e617d6903284)
   INFO: C:\Users\Megam\Downloads\Botan-2.10.0\Botan-2.10.0\configure.py invoked with options "--cc=msvc --cpu=x64 --os=windows"
   INFO: Autodetected platform information: OS="Windows" machine="AMD64" proc="Intel64 Family 6 Model 58 Stepping 9, GenuineIntel"
   INFO: Canonicalized CPU target x64 to x86_64
   INFO: Auto-detected compiler version 19.16
   INFO: Auto-detected compiler arch x86_64
   INFO: Target is msvc:19.16-windows-x86_64
   INFO: Skipping (dependency failure): certstor_sqlite3 sessions_sqlite3
   INFO: Skipping (incompatible CPU): aes_armv8 aes_power8 pmull sha1_armv8 sha2_32_armv8 sm4_armv8
   INFO: Skipping (incompatible OS): certstor_system_macos commoncrypto dev_random fd_unix getentropy proc_walk
   INFO: Skipping (incompatible compiler): sha2_32_bmi2 sha2_64_bmi2 sha3_bmi2
   INFO: Skipping (no enabled compression schemes): compression
   INFO: Skipping (requires external dependency): bearssl boost bzip2 lzma openssl sqlite3 tpm zlib
   INFO: Using SIMD module simd_avx2
WARNING: win32_stats: This module can cause false positives with antivirus systems
   INFO: Loading modules: adler32 aead aes aes_ni aes_ssse3 aont aria asn1 auto_rng base base32 base58 base64 bcrypt bigint blake2 block blowfish camellia cascade cast128 cast256 cbc cbc_mac ccm cecpq1 certstor_sql cfb chacha chacha20poly1305 chacha_avx2 chacha_rng chacha_simd32 checksum clmul clmul_ssse3 cmac codec_filt comb4p cpuid crc24 crc32 cryptobox ctr curve25519 des dh dl_algo dl_group dlies dsa dyn_load eax ec_group ecc_key ecdh ecdsa ecgdsa ecies eckcdsa ed25519 elgamal eme_oaep eme_pkcs1 eme_raw emsa1 emsa_pkcs1 emsa_pssr emsa_raw emsa_x931 entropy ffi filters fpe_fe1 gcm gmac gost_28147 gost_3410 gost_3411 hash hash_id hex hkdf hmac hmac_drbg hotp http_util idea idea_sse2 iso9796 kasumi kdf kdf1 kdf1_iso18033 kdf2 keccak keypair lion locking_allocator mac mce mceies md4 md5 mdx_hash mem_pool mgf1 misty1 mode_pad modes mp newhope nist_keywrap noekeon noekeon_simd numbertheory ocb ofb par_hash passhash9 pbes2 pbkdf pbkdf1 pbkdf2 pem pgp_s2k pk_pad pkcs11 poly1305 poly_dbl prf_tls prf_x942 psk_db pubkey rc4 rdrand rdrand_rng rdseed rfc3394 rfc6979 rmd160 rng rsa salsa20 scrypt seed serpent serpent_avx2 serpent_simd sessions_sql sha1 sha1_sse2 sha1_x86 sha2_32 sha2_32_x86 sha2_64 sha3 shacal2 shacal2_simd shacal2_x86 shake shake_cipher simd simd_avx2 siphash siv skein sm2 sm3 sm4 socket sp800_108 sp800_56a sp800_56c srp6 stateful_rng stream streebog system_rng thread_utils threefish_512 threefish_512_avx2 tiger tls tls_cbc tss twofish utils uuid whirlpool win32_stats x509 x919_mac xmss xtea xts
   INFO: Defaulting to assuming little endian
   INFO: Using hardlink to link files into build dir (use --link-method to change)
   INFO: Botan 2.10.0 (revision git:3a459487df5de4cb411efdda0010e617d6903284) (release dated 20190330) build setup is complete

C:\Users\Megam>nmake

Utilidad de mantenimiento de programas de Microsoft (R) versión 14.16.27027.1
(C) Microsoft Corporation. Todos los derechos reservados.

        cl /DBOTAN_DLL=__declspec(dllexport) /MD /bigobj /EHs /GR /D_ENABLE_EXTENDED_ALIGNED_STORAGE /O2 /Oi /W4 /wd4250 /wd4251 /wd4275  /Ibuild\include /Ibuild\include\external /nologo /c C:/Users/Megam/Downloads/Botan-2.10.0/Botan-2.10.0/src/lib/asn1/alg_id.cpp /Fobuild\obj\lib\asn1_alg_id.obj
alg_id.cpp
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\cstddef(7): fatal error C1083: No se puede abrir el archivo incluir: 'stddef.h': No such file or directory
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\cl.EXE"' : código devuelto '0x2'
Stop.

C:\Users\Megam>

安装的 Python:

图片

运行后的CL.exe vcvars64.bat

图片

我的 Visual Studio 安装:

图片

更新:

运行后包含变量vcvars64.bat

INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include;
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include;
C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um;
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt;
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared;
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um;
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt;
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt
4

1 回答 1

1

似乎错误在目录中,该目录不存在 C: \ Program Files (x86) \ Windows Kits \ 10 \ include \ 10.0.18362.0 \ ucrt;

我卸载了其他 Windows 工具包来解决问题。并且已经可以编译 Botan。

INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include;
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include;
C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um;
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt;
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared;
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um;
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt;
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt

实际INCLUDE变量内容:

INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include;
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include;
C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um;
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt;
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared;
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um;
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt;
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt

现在编译Botan。

感谢您的快速回复。

图片

于 2019-05-24T20:52:43.590 回答