GmSSL icon indicating copy to clipboard operation
GmSSL copied to clipboard

最新版编译报错,1.3版本就没有问题

Open mixuan opened this issue 8 years ago • 3 comments

crypto/aes/aes_core.c:632:5: error: conflicting types for 'AES_set_encrypt_key' int AES_set_encrypt_key(const unsigned char *userKey, int bits,
^ include/openssl/aes.h:43:5: note: previous declaration is here int AES_set_encrypt_key(const unsigned char *userKey, const unsigned int bits, ^ 1 error generated. make[1]: *** [crypto/aes/aes_core.o] Error 1 make: *** [all] Error 2

现在编译ios库都是报这个错误了 编译步骤: 1../Configure iphoneos-cross --prefix=/usr/local --openssldir=/usr/local/openssl 2.修改makefile以下代码 CC= /Applications/XCode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7s CFLAGS=-DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_STATIC_ENGINE -DOPENSSL_PIC -DOPENSSLDIR=""$(OPENSSLDIR)"" -DENGINESDIR=""$(ENGINESDIR)"" -O3 -D_REENTRANT -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk 3.make 然后就报上面的错误

mixuan avatar Feb 23 '18 00:02 mixuan

我把632行那个int bits改为const unsigned int bits就可以编译下去了,然后又报错。。。 crypto/saf/saf_keyhandle.c:89:7: error: implicit declaration of function 'RAND_bytes' is invalid in C99 [-Werror,-Wimplicit-function-declaration] || !RAND_bytes(keybuf, EVP_CIPHER_key_length(cipher))

mixuan avatar Feb 23 '18 02:02 mixuan

缺哪个就在那里补上就可以了

mixuan avatar Feb 23 '18 06:02 mixuan

你后来怎么解决了

LanCat avatar Apr 02 '18 07:04 LanCat