On 23/07/2015 10:47, Song Geng wrote: > Hi guys, > > I am a novice about openssl. I encounter linker error when I try to > compile evp demos which locate openssl/demos/evp. > > My computer info is: > Darwin Kernel Version 14.4.0: Thu May 28 11:35:04 PDT 2015; > root:xnu-2782.30.5~1/RELEASE_X86_64 > > And I use both gcc and clang with command ?cc -g -Wall -I../../include > -lcrypto aesgcm.c" to compile the source code. > > The error info shows: > Undefined symbols for architecture x86_64: > "_EVP_aes_256_gcm", referenced from: > _aes_gcm_encrypt in aesgcm-093314.o > _aes_gcm_decrypt in aesgcm-093314.o > ld: symbol(s) not found for architecture x86_64 > clang: error: linker command failed with exit code 1 (use -v to see > invocation) > Please help me. I will be very appreciate. > Try adding a compiler option to also take libraries from the local copy of OpenSSL (I assume you did build OpenSSL itself first). Without such an option, you might be accidentally linking against a too old libcrypto from Apple. Enjoy Jakob -- Jakob Bohm, CIO, Partner, WiseMo A/S. http://www.wisemo.com Transformervej 29, 2860 S?borg, Denmark. Direct +45 31 13 16 10 This public discussion message is non-binding and may contain errors. WiseMo - Remote Service Management for PCs, Phones and Embedded