[Ur] compiling javascript ffi example

Timothy Beyer beyert at fastmail.net
Wed Apr 25 04:07:59 EDT 2012


Hi,

In trying to learn the javascript FFI for Ur/Web, I recently made an example based on the C FFI example from the wiki. (http://www.impredicative.com/wiki/index.php/Ur_C_FFI_Example)  Basically, it consists of "lib" and "app", with the three javascript functions "hello", "counter" and "important".

Unfortunately, I can't get it to compile, although I am confident that it is close to working.  I get the following errors from gcc when I compile "app":

> urweb app
cc1: warnings being treated as errors
/tmp/fileHhSFRZ/webapp.c: In function '__uwn_wrap_counter_1272':
/tmp/fileHhSFRZ/webapp.c:49: warning: implicit declaration of function 'uw_Lib_counter'
/tmp/fileHhSFRZ/webapp.c: In function '__uwn_wrap_main_1271':
/tmp/fileHhSFRZ/webapp.c:82: warning: implicit declaration of function 'uw_Lib_hello'
/tmp/fileHhSFRZ/webapp.c:83: warning: passing argument 2 of 'uw_Basis_htmlifyString_w' makes pointer from integer without a cast
/tmp/fileHhSFRZ/webapp.c:88: warning: implicit declaration of function 'uw_Lib_important'
/tmp/fileHhSFRZ/webapp.c:89: warning: passing argument 2 of 'uw_Basis_htmlifyString_w' makes pointer from integer without a cast
*** Error code 1

The modified example from the wiki is attached as a bzipped tarball.

Regards,
Tim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: js_ffi_test_v3.tar.bz2
Type: application/octet-stream
Size: 862 bytes
Desc: not available
URL: <http://www.impredicative.com/pipermail/ur/attachments/20120425/5d486c24/attachment.obj>
-------------- next part --------------



More information about the Ur mailing list