I am trying to make a NesC program to use with TOSSIM (TinyOS simulator) including the gmp library Here is a sample of my code
event void Boot.booted()
{
//dbg("MAPC", "Booted\n");
//int g = 2;
const char * const num = "10387922662657137735272585565990678424704150824246588991894422884684285337052622755228646547137908394766337363629003511269209591656314972254747436173398683";
int err;
mpz_t n;
err = mpz_init_set_str(n, num, 10);
dbg("MAPC","%d",sizeof(n));
mpz_clear(n);
}
The compile runs fine using make micaz sim
or env "CFLAGS = -lgmp" make micaz sim
When I try to execute it via a python script I get this error:
Traceback (most recent call last):
File "kdk.py", line 4, in <module>
from TOSSIM import *
File "/opt/tinyos-2.1.2/apps/MAP/TOSSIM.py", line 7, in <module>
import _TOSSIM
ImportError: /opt/tinyos-2.1.2/apps/MAP/_TOSSIMmodule.so: undefined symbol: __gmpz_init_set_str