1

このhttp://x2on.de/2010/12/16/tutorial-script-for-building-openssl-for-ios-iphoneipad/を使用してopensslライブラリをコンパイルしようとしましたが、

In file included from cryptlib.c:117:
cryptlib.h:62:20: error: stdlib.h: No such file or directory
cryptlib.h:63:20: error: string.h: No such file or directory
In file included from cryptlib.h:65,
                 from cryptlib.c:117:
../e_os.h:444:30: error: unistd.h: No such file or directory
../e_os.h:449:29: error: sys/types.h: No such file or directory
In file included from cryptlib.h:72,
                 from cryptlib.c:117:
../include/openssl/crypto.h:125:19: error: stdio.h: No such file or directory
In file included from cryptlib.h:72,
                 from cryptlib.c:117:
../include/openssl/crypto.h:175: error: expected specifier-qualifier-list before ‘size_t’
../include/openssl/crypto.h:465: warning: parameter names (without types) in function declaration
../include/openssl/crypto.h:465: error: expected declaration specifiers or ‘...’ before ‘size_t’
../include/openssl/crypto.h:466: warning: parameter names (without types) in function declaration
../include/openssl/crypto.h:467: error: expected ‘)’ before ‘const’
../include/openssl/crypto.h:468: error: expected ‘;’, ‘,’ or ‘)’ before ‘void’
../include/openssl/crypto.h:470: error: expected ‘)’ before ‘const’
../include/openssl/crypto.h:471: error: expected ‘;’, ‘,’ or ‘)’ before ‘void’
../include/openssl/crypto.h:477: warning: parameter names (without types) in function declaration
../include/openssl/crypto.h:477: error: expected declaration specifiers or ‘...’ before ‘size_t’
../include/openssl/crypto.h:478: warning: parameter names (without types) in function declaration
../include/openssl/crypto.h:479: error: expected ‘)’ before ‘const’
../include/openssl/crypto.h:480: error: expected ‘;’, ‘,’ or ‘)’ before ‘void’
../include/openssl/crypto.h:482: error: expected ‘)’ before ‘const’
../include/openssl/crypto.h:483: error: expected ‘;’, ‘,’ or ‘)’ before ‘void’
../include/openssl/crypto.h:500: error: expected declaration specifiers or ‘...’ before ‘size_t’
../include/openssl/crypto.h:535: error: expected ‘)’ before ‘*’ token
In file included from cryptlib.h:74,
                 from cryptlib.c:117:
../include/openssl/bio.h:634: error: expected ‘)’ before ‘*’ token
../include/openssl/bio.h:706: error: expected ‘)’ before ‘*’ token
../include/openssl/bio.h:707: error: expected ‘)’ before ‘*’ token
In file included from ../include/openssl/err.h:127,
                 from cryptlib.h:75,
                 from cryptlib.c:117:
../include/openssl/lhash.h:186: error: expected declaration specifiers or ‘...’ before ‘FILE’
../include/openssl/lhash.h:187: error: expected declaration specifiers or ‘...’ before ‘FILE’
../include/openssl/lhash.h:188: error: expected declaration specifiers or ‘...’ before ‘FILE’
In file included from cryptlib.h:75,
                 from cryptlib.c:117:
../include/openssl/err.h:140:19: error: errno.h: No such file or directory
In file included from cryptlib.h:75,
                 from cryptlib.c:117:
../include/openssl/err.h:343: error: expected ‘)’ before ‘*’ token
cryptlib.c: In function ‘CRYPTO_THREADID_set_numeric’:
cryptlib.c:430: warning: incompatible implicit declaration of built-in function ‘memset’
cryptlib.c: In function ‘CRYPTO_THREADID_set_pointer’:
cryptlib.c:441: warning: incompatible implicit declaration of built-in function ‘memset’
cryptlib.c: In function ‘CRYPTO_THREADID_current’:
cryptlib.c:507: error: ‘errno’ undeclared (first use in this function)
cryptlib.c:507: error: (Each undeclared identifier is reported only once
cryptlib.c:507: error: for each function it appears in.)
cryptlib.c: In function ‘CRYPTO_THREADID_cpy’:
cryptlib.c:518: warning: incompatible implicit declaration of built-in function ‘memcpy’
cryptlib.c: In function ‘OPENSSL_showfatal’:
cryptlib.c:906: error: ‘stderr’ undeclared (first use in this function)
cryptlib.c: In function ‘OpenSSLDie’:
cryptlib.c:918: warning: incompatible implicit declaration of built-in function ‘abort’
cryptlib.c: In function ‘OPENSSL_stderr’:
cryptlib.c:926: error: ‘stderr’ undeclared (first use in this function)
make[1]: *** [cryptlib.o] Error 1
make: *** [build_crypto] Error 1
What can I fix it 

このエラーを修正する方法を教えてください。ありがとうございました。

4

3 に答える 3

0

必要に応じて、プロジェクトで Cocoapods を使用することを検討してから、次のようなポッドを使用できます: https://github.com/krzak/OpenSSL

Podfileに追加するだけです:

pod 'OpenSSL', :podspec => 'https://raw.github.com/krzak/OpenSSL/master/OpenSSL.podspec'

コーディングを行います。

于 2013-10-21T00:23:28.377 に答える
0

このhttp://x2on.de/2010/12/16/tutorial-script-for-building-openssl-for-ios-iphoneipad/を使用してopensslライブラリをコンパイルしようとしましたが、

問題は、パスと sysroot の問題によるものです。見た目からすると、そのスクリプトは恐ろしいハックです。

OpenSSL プロジェクトには、環境を設定し、iOS デバイス用のライブラリを構築するために使用するスクリプトがあります。ここで見つけることができます: setenv-ios,sh。残念ながら、Web 上やその wiki にはドキュメントがありません。ただし、これはOpenSSL FIPS User Guide 2.0でカバーされています (付録 E を参照)。

これは、ライブラリを構築するために使用するレシピです (スクリプトを使用します)。OpenSSL tar ボールとスクリプトが同じディレクトリ (以下の「ルート」ディレクトリ) にあることを確認します。

# Start fresh
$ rm -rf openssl-1.0.1e/
$ chmod a+x setenv-ios-11.sh

# From the 'root' directory
$ . ./setenv-ios-11.sh
$ tar xzf openssl-1.0.1e.tar.gz
$ cd openssl-1.0.1e/

$ perl -pi -e 's/install: all install_docs install_sw/install:install_docs install_sw/g' Makefile.org
$ ./config shared -no-ssl2 -no-ssl3 -no-comp -no-hw -no-engine --openssldir=/usr/local/ssl/ios-6.1

$ make depend
$ make all
$ sudo -E make install

先頭の「.」を必ず含めてください。(ドット) 環境を設定するとき。インストール後、ヘッダーとライブラリは/usr/local/ssl/ios-6.1.

問題がある場合は、OpenSSL FIPS User Guide 2.0を参照してください。ただし、FIPS 関連のものは無視してください。

于 2013-10-02T07:38:40.990 に答える
0

このエラーは、Windows SDK 10 と Windows Driver SDK 10 の両方が同時にインストールされている場合にも発生する可能性があります。このような状況では、VCVARS が誤ったインクルード パスを設定するようです。

于 2016-11-17T09:19:17.047 に答える