Win32 cygwin users may try: COMPILER_ARGS= -mno-cygwin -I....../jdk1.5.0/include -I....../jdk1.5.0/include/win32 LINKER_ARGS_1 = --add-stdcall-alias /usr/lib/mingw/dllcrt2.o LINKER_ARGS_2 = -L/usr/lib/mingw -lmingw32 -lmingwex -lmsvcrt Only for level 1, try the following compiler arguments: COMPILER_ARGS= -mno-cygwin -I....../jdk1.5.0/include -I....../jdk1.5.0/include/win32 -Wl,--add-stdcall The COOJA Simulator - JNI Tests There examples may help understand errors during compilation from inside COOJA. For some examples; "ant help". ant level1 Runs JNI test level 1: [compilation test] Compiles level1.c to level1.library, using only c compiler. Java class loads the library and calls a simple native function. ant level2 Runs JNI test level 2: [compilation test] Compiles level2.c to level2.library, using both c compiler and linker. Java class loads the library and calls a simple native function. ant level3 Runs JNI test level 3: [map file parsing test] Compiles java + c. The map file is parsed, and information about data+bss sections is outputted. ant level4 Runs JNI test level 4: [fetching reference var] Calculates offset between relative (mapfile) and absolute memory. A simple native function increases two counters (from both data and bss sections). ant level5 Runs JNI test level 5: [fetches and restores memory segments - the final test] A simple native function increases two counters (from both data and bss sections). The current memory (data+bss sections) is fetched and restored between function calls. The counters should be restored with the memory!