To summarize what I did:
I modified the file to include the <inttypes.h>
and changed the printf
statements as instructed by Mohit Jain.
Then I executed
gcc -fPIC -shared extension-functions.c -o libsqlitefunctions.so -lm
to compile the c file. Note that the -lm
is at the end. Apparently this does matter.
After that you can include the libsqlitefunctions.so
by calling
SELECT load_extension('/full/path/to/libsqlitefunctions.so');
before calling any of the new math functions.
Cheers,
D.
PS: if you want to use it with Doctrine, you might want to follow this thread.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…