<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">Finally I found the reason. The program find lib “crypto” in the default path. And my system has installed a openssl-0.98. That version doesn’t support “gcm”.</div><div class=""><br class=""></div><div class="">I installed a new version openssl from source code, but it only generate libcrypto.a in directory “lib/“. And I notice that there’s the libcrypto.dylib in /usr/lib. So I use brew to install the latest openssl in from the repo. Then use command as follows:</div><div class=""><br class=""></div><div class=""> <font color="#00a3d7" style="font-size: 14px;" class="">cc -g -L/path/to/brew repo/openssl/1.0.2a-1/lib/ -Wall -I../../include  -o test aesgcm.c  -lcrypto</font></div><div class=""><font color="#00a3d7" style="font-size: 14px;" class=""><br class=""></font></div><div class="">It works.</div><div class=""><br class=""><div apple-content-edited="true" class="">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class=""><div class="">Br, Great Soul</div><div class=""><a href="mailto:soul.great@me.com" class="">soul.great@me.com</a></div><div class=""><br class=""></div></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline">
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Jul 24, 2015, at 7:52 PM, <a href="mailto:Stefan.Neis@t-online.de" class="">Stefan.Neis@t-online.de</a> wrote:</div><br class="Apple-interchange-newline"><div class=""><title class=""></title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" class=""><div class=""><div style="position: relative; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Arial, Helvetica, sans-serif;" class="">> And I use both gcc and clang with command “<span class="" style="font-size: 14px;"><span style="color: #0061ff;" class="">cc -g -Wall -I../../include -lcrypto aesgcm.c</span></span>" to compile the source code.</div>
<div style="position: relative; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Arial, Helvetica, sans-serif;" class=""><span style="font-family: arial, helvetica, sans-serif; font-size: 10pt; text-decoration: none;" class="">Long version:</span></div>
<div style="position: relative; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Arial, Helvetica, sans-serif;" class=""><span style="font-family: arial, helvetica, sans-serif; font-size: 10pt; text-decoration: none;" class="">Note that the linker processes its libraries from left to right, e.g. if you have an object file object.o and to libraries</span></div>
<div style="position: relative; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Arial, Helvetica, sans-serif;" class=""><span style="font-family: arial, helvetica, sans-serif; font-size: 10pt; text-decoration: none;" class="">liba.a and libb.a, then "cc object.o -la -lb" will first collect all unresolved symbols in the object files, then it will</span></div>
<div style="position: relative; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Arial, Helvetica, sans-serif;" class=""><span style="font-family: arial, helvetica, sans-serif; font-size: 10pt; text-decoration: none;" class="">resolve whatever it can resolve with the files in liba.a, possibly adding new unresolved symbols and finally it</span></div>
<div style="position: relative; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Arial, Helvetica, sans-serif;" class=""><span style="font-family: arial, helvetica, sans-serif; font-size: 10pt; text-decoration: none;" class="">will try to resolve the remaining symbols with libb.a. If you do "cc object.o -lb -la", it will again start with the</span></div>
<div style="position: relative; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Arial, Helvetica, sans-serif;" class=""><span style="font-family: arial, helvetica, sans-serif; font-size: 10pt; text-decoration: none;" class="">symbols from object.o, resolve what it can against libb.a, then resolve the reamaining stuff against liba.a and</span></div>
<div style="position: relative; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Arial, Helvetica, sans-serif;" class=""><span style="font-family: arial, helvetica, sans-serif; font-size: 10pt; text-decoration: none;" class="">if it adds any symbol from liba.a that needs something from libb.a you get an error.</span></div>
<div style="position: relative; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Arial, Helvetica, sans-serif;" class=""><span style="font-family: arial, helvetica, sans-serif; font-size: 10pt; text-decoration: none;" class="">If you do "cc -lb -la object.o", it will start with no symbols, add whatever it needs to resolve the symbols from</span></div>
<div style="position: relative; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Arial, Helvetica, sans-serif;" class=""><span style="font-family: arial, helvetica, sans-serif; font-size: 10pt; text-decoration: none;" class="">libb.a (i.e. nothing), then adds whatever it needs from liba.a (i.e. nothing), then add object.o and complain</span></div>
<div style="position: relative; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Arial, Helvetica, sans-serif;" class=""><span style="font-family: arial, helvetica, sans-serif; font-size: 10pt; text-decoration: none;" class="">about everything that remains unresolved.</span></div>
<div style="position: relative; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Arial, Helvetica, sans-serif;" class=""> </div>
<div style="position: relative; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Arial, Helvetica, sans-serif;" class=""><span style="font-family: arial, helvetica, sans-serif; font-size: 10pt; text-decoration: none;" class="">In short: try "cc ... aesgcm.c -lcrypto", that should work.</span></div>
<div style="position: relative; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Arial, Helvetica, sans-serif;" class=""> </div>
<div style="position: relative; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Arial, Helvetica, sans-serif;" class=""><span style="font-family: arial, helvetica, sans-serif; font-size: 10pt; text-decoration: none;" class="">        Regards,</span></div>
<div style="position: relative; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Arial, Helvetica, sans-serif;" class=""><span style="font-family: arial, helvetica, sans-serif; font-size: 10pt; text-decoration: none;" class="">                  Stefan</span></div></div>_______________________________________________<br class="">openssl-dev mailing list<br class="">To unsubscribe: <a href="https://mta.openssl.org/mailman/listinfo/openssl-dev" class="">https://mta.openssl.org/mailman/listinfo/openssl-dev</a><br class=""></div></blockquote></div><br class=""></div></body></html>