<div dir="ltr">Hmm.  Maybe try creating the class method:<div><br></div><div>moduleName</div><div>   ^&#39;madgwickIMU&#39;</div><div><br></div><div>(assuming you haven&#39;t already).</div><div><br></div><div><br></div><div>-cbc</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 9, 2015 at 11:17 AM, tim Rowledge <span dir="ltr">&lt;<a href="mailto:tim@rowledge.org" target="_blank">tim@rowledge.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I’m trying - and so far failing - to do what should surely be a very simple thing. This isn’t a new situation…<br>
especially on unix.<br>
<br>
I have a single C file with just two functions. I have a matching H file. I want to make them into a dynamic library that I can call via FFI. This really shouldn’t be rocket science stuff!<br>
<br>
So far I can<br>
a) compile the C file (well duh)<br>
b) link it as a shared library<br>
c) install it in /usr/local/lib (next to another library that I can use from FFI already, so I know the path gets looked at)<br>
d) set the permissions to match the working library<br>
e) use from a simple C program to prove it works<br>
<br>
However, all I get from squeak is an error that the external module is not found. I’ll take a look with a debug vm but I’d  be very happy to hear that I’m forgetting some trivial flag or incantation that can short-circuit the ‘fun’ of using gdb.<br>
<br>
Here is the code and makefile -<br>
<a href="https://copy.com/DGDbpJM4wnHQrDUG" rel="noreferrer" target="_blank">https://copy.com/DGDbpJM4wnHQrDUG</a><br>
<br>
What I’ve been doing to build &amp; try is<br>
make clean<br>
make<br>
sudo install -m 0755 libmadgwickIMU..s0.1 /usr/local/lib/libmadgwickIMU.so.1<br>
sudo ln -sf /usr/local/lib/libmadgwickIMU.so.1 /usr/local/lib/libmadwickIMU.so<br>
sudo ldconfig<br>
gcc -Wall -o testing testing.c -lmadwickIMU<br>
./testing<br>
<br>
‘testing’ seem to do the right thing. Going into squeak (cog/spur/pi) and trying a method like -<br>
invSqrt: floatval<br>
#&lt;cdecl: float ‘invSqrt’ (float) module: ‘madgwickIMU’&gt;<br>
^self externalCallFailed<br>
- just gives me the not found module error.<br>
<br>
I’ve restarted squeak after building the lib, I’ve opened a new terminal after building the lib (just in case there’s some stupid path-exporting nonsense I don’t understand etc) and I’ve made sure to smile only on the left side. What on earth am I forgetting?<br>
<br>
tim<br>
--<br>
tim Rowledge; <a href="mailto:tim@rowledge.org">tim@rowledge.org</a>; <a href="http://www.rowledge.org/tim" rel="noreferrer" target="_blank">http://www.rowledge.org/tim</a><br>
Useful Latin Phrases:- Braccae illae virides cum subucula rosea et tunica Caledonia-quam elenganter concinnatur! = Those green pants go so well with that pink shirt and the plaid jacket!<br>
<br>
<br>
<br>
</blockquote></div><br></div>