| /* There are two options: |
| Link this program with _embedding_test.so. |
| gcc -o embedding_test embedding_test.c _embedding_cffi*.so |
| You must then run the executable with the right command |
| (LD_LIBRARY_PATH on Linux), otherwise it won't find the |
| LD_LIBRARY_PATH=. ./embedding_test |
| There are platform-specific options to gcc to avoid needing |
| gcc -o embedding_test embedding_test.c _embedding_cffi*.so \ |
| Compile and link the _embedding_test.c source code together with |
| this example (e.g. with PyPy): |
| gcc -o embedding_test embedding_test.c _embedding_cffi.c \ |
| -I/opt/pypy/include -pthread -lpypy-c |
| extern int add(int x, int y); |
| printf("result: %d\n", res); |
| printf("result: %d\n", res); |