Mercurial > urweb
annotate tests/caseFfi.ur @ 1892:907a82a44f01
Add missing inter-library dependencies
This is needed, at least on recent Ubuntu, to fix these linker errors
when compiling any Ur/Web application:
liburweb.so: undefined reference to `lround'
liburweb.so: undefined reference to `ceil'
liburweb.so: undefined reference to `RAND_bytes'
liburweb.so: undefined reference to `DES_fcrypt'
liburweb.so: undefined reference to `SHA256_Init'
liburweb.so: undefined reference to `SHA256_Final'
liburweb.so: undefined reference to `SHA256_Update'
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
src/c/Makefile.am | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
author | Anders Kaseorg <andersk@mit.edu> |
---|---|
date | Thu, 21 Nov 2013 14:32:11 -0500 |
parents | 71bafe66dbe1 |
children |
rev | line source |
---|---|
adamc@185 | 1 extern structure M : sig |
adamc@185 | 2 datatype t = A | B |
adamc@185 | 3 datatype u = C of t | D |
adamc@185 | 4 end |
adamc@185 | 5 |
adamc@185 | 6 val f = fn x => case x of M.A => M.B | M.B => M.A |
adamc@185 | 7 |
adamc@185 | 8 val t2s = fn x => case x of M.A => "A" | M.B => "B" |
adamc@185 | 9 |
adamc@185 | 10 val g = fn x => case x of M.C a => M.C (f a) | M.D => M.C M.A |
adamc@185 | 11 |
adamc@185 | 12 val u2s = fn x => case x of M.C a => t2s a | M.D => "D" |
adamc@185 | 13 |
adamc@185 | 14 val page = fn x => <html><body> |
adamc@185 | 15 {cdata (t2s x)} |
adamc@185 | 16 </body></html> |
adamc@185 | 17 |
adamc@185 | 18 val page2 = fn x => <html><body> |
adamc@185 | 19 {cdata (u2s x)} |
adamc@185 | 20 </body></html> |
adamc@185 | 21 |
adamc@185 | 22 val main : unit -> page = fn () => <html><body> |
adamc@185 | 23 <li><a link={page M.A}>A</a></li> |
adamc@185 | 24 <li><a link={page M.B}>B</a></li> |
adamc@185 | 25 <li><a link={page2 (M.C M.A)}>C A</a></li> |
adamc@185 | 26 <li><a link={page2 (M.C M.B)}>C B</a></li> |
adamc@185 | 27 <li><a link={page2 M.D}>D</a></li> |
adamc@185 | 28 </body></html> |