9 years, 3 months ago.

missing functions _exit _kill _getpid

Hi,

Trying to compile a version of the 'morsegenerator' code , I had to add 3 functions to my code:

extern "C" { deze functies misten ?? void _exit(int code) {} void _kill(int pid, int sig){} int _getpid(){return 1;} }

Without this code the online compiler gives 2 errors , 0 and -241

/media/uploads/kostoel/capture_1.png

Where should this extra code be added in the code tree ?

Using : 29dec14 , mbed compiler , also W7 with Eclipse Luna 64b and GNU ARM Eclipse plugin version 2.5.1-201412191510 , , GNU Tools for ARM Embedded Processors version 4.9-2014-q4-major, STM32F4 Discovery board.

cheers , ko stoel

1 Answer

9 years, 3 months ago.

The online compiler shouldn't get errors about these functions since they are related to the newlib library typically used by GNU toolchains. It looks like you are getting a different error with the online compiler that I see others have complained about recently. Looks like it is something wrong with the servers themselves.

Now for your Eclipse project, things are probably easier if you just have it build from the Makefile that is generated when you export your project from the online compiler. I believe that the exported Makefile pulls in the implementation of those functions from libnosys.a which ships with the GNU Tools for ARM Embedded Processors toolchain.

LD_SYS_LIBS = -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys