<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=""><div class="">I’m getting the following error when compiling a project which uses the C FFI and links to the openssl library.  A similar post (<a href="http://www.impredicative.com/pipermail/ur/2012-October/001241.htm" class="">http://www.impredicative.com/pipermail/ur/2012-October/001241.htm</a>) mentioned linking lpq at the end of the commands but this sample project doesn’t include lpq. Any ideas on what I might be doing wrong?  Thanks!</div><div class=""><br class=""></div><div class=""><div class="">th@ubuntu:~/Documents/urwebapps/sample$ urweb sample -debug</div><div class="">gcc  -pthread -Wimplicit -Werror -Wno-unused-value -I /usr/local/include/urweb  -c "/tmp/webapp.c" -o "/tmp/webapp.o" -g</div><div class="">gcc -Werror  -pthread  "/tmp/webapp.o" -L/usr/local/lib -lurweb_http -lurweb -lm -lcrypto -lssl  -o "/home/toddroth/Documents/urwebapps/sample/sample.exe" -g /home/toddroth/Documents/urwebapps/sample/crypt/crypt.o</div><div class="">/usr/bin/ld: /home/toddroth/Documents/urwebapps/sample/crypt/crypt.o: undefined reference to symbol 'SHA256@@OPENSSL_1.0.0'</div><div class="">/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libcrypto.so: error adding symbols: DSO missing from command line</div><div class="">collect2: error: ld returned 1 exit status</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><b class="">Library Files</b></div><div class=""><br class=""></div><div class=""><b class="">crypt.urs</b></div><div class=""><div class="">--------------------------------------------------------------------------------------------------------------</div><div class="">val hello : unit -> string</div><div class="">val sha256 : string -> string</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><b class="">crypt.h</b></div><div class=""><div class="">--------------------------------------------------------------------------------------------------------------</div></div><div class="">#include <urweb.h></div><div class=""><div class=""><br class=""></div><div class="">uw_Basis_string uw_Crypt_hello(uw_context, uw_unit);</div><div class="">uw_Basis_string uw_Crypt_sha256(uw_context ctx, uw_Basis_string data);</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><b class="">crypt.c</b></div><div class=""><div class="">--------------------------------------------------------------------------------------------------------------</div></div><div class=""><div class="">#include <string.h></div><div class="">#include <stdio.h></div><div class="">#include <openssl/evp.h></div><div class="">#include <openssl/sha.h></div><div class="">#include <urweb.h></div><div class=""><br class=""></div><div class="">uw_Basis_string uw_Crypt_hello(uw_context ctx, uw_unit u) {</div><div class="">  return "Hello";</div><div class="">}</div><div class=""><br class=""></div><div class="">uw_Basis_string uw_Crypt_sha256(uw_context ctx, uw_Basis_string data) {</div><div class="">  unsigned char dataBin[128], out[EVP_MAX_MD_SIZE];</div><div class="">  int len;</div><div class="">  </div><div class="">  len = unbase64((unsigned char *)data, strlen(data), dataBin, sizeof dataBin);</div><div class="">      </div><div class="">  SHA256(dataBin, len, out);</div><div class="">  return base64(ctx, out, SHA256_DIGEST_LENGTH);</div><div class="">}</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><b class="">lib.urp</b></div><div class=""><div class="">--------------------------------------------------------------------------------------------------------------</div><div class=""></div></div><div class=""><div class="">ffi crypt</div><div class="">include crypt.h</div><div class="">link crypt.o</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><b class="">Makefile</b></div><div class=""><div class=""><div class=""><div class=""><div class="">--------------------------------------------------------------------------------------------------------------</div><div class=""></div></div><div class=""></div></div><div class=""><div class="">CFLAGS := -I/usr/local/include/urweb</div><div class=""><br class=""></div><div class="">all: crypt.o</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><b class="">Project Files</b></div><div class=""><br class=""></div><div class="">sample.urp</div><div class=""><div class=""><div class="">--------------------------------------------------------------------------------------------------------------</div><div class=""></div></div><div class=""></div></div><div class=""><div class="">library crypt/lib</div><div class=""><br class=""></div><div class="">sample</div></div><div class=""></div></div><div class=""></div></div></body></html>