Note that there are some explanatory texts on larger screens.

plurals
  1. POjavascript extension to use C based APIs(clutter) in a webapp
    primarykey
    data
    text
    <p><strong>My goal is to use the C libraries to form web apps.</strong></p> <p>I have choosen the way to do that via using "SWIG" tool. The Swig tool requires three things</p> <pre><code>1) .c file which defines all the functions. 2) .i file also called interface file which is creating the interface to load the APIs wherin I used the extern keyword. 3) APP written in javascript extension (.js file). </code></pre> <p>I used SWIG tool to compile and run this app to verify the .js file has made correctly. The application is running fine on XMING X11 window.</p> <p>On compilation it creates _wrap.o, .o file and libFILENAME.so</p> <p>Now I want to run this <em>app</em> on browser page.</p> <p>For this I have used the webkit clutter port which gives us the MxLauncher code. I'm using webkit_iweb_view_load_uri(WEBKIT_IWEB_VIEW(view), "filename.html"); API to load my html file to run that javascript on my webpage view.</p> <p>I'm linking the .so created at the compilation time. </p> <p><em><strong>Error Message</em>: JS CONSOLE: file:///filename.js: ReferenceError: Can't find variable: example</strong></p> <p><strong>filename.c</strong> </p> <pre><code>int gcd(int x, int y) `enter code here`{ int g; g = y; while (x &gt; 0) { g = x; x = y % x; y = g; } return g; } </code></pre> <p><strong>filename.i</strong> </p> <pre><code>%module example extern int gcd(int x, int y); </code></pre> <p><strong>filename.js</strong></p> <pre><code>x = 42; y = 105; g = example.gcd(x,y); </code></pre> <p>How to get my goal to be achieved?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload