7 years, 1 month ago.

about Keil

I want to debug program about mbed, I export a program from mbed wed. it is successful running from web, the code is

1.#include "mbed.h"

Read temperature from LM75BD 2.Serial pc(USBTX, USBRX); tx, rx DigitalOut myled(LED1); I2C i2c(p28, p27);

int addr = 0xde; int j=0; int main() { char cmd[2]; cmd[0] = 0x00; cmd[1] = 0x80; i2c.write(addr, cmd, 2); i2c.start(); i2c.write(addr); i2c.write(00); i2c.write(0x00); i2c.stop(); wait(0.5);

cmd[0] = 0x00;

while(1){ i2c.write(addr, cmd, 1); addr=0xdf; i2c.start(); myled=1; j=i2c.write(0xdf); j=i2c.write(0x00); cmd[0]=i2c.read(0); i2c.stop(); pc.printf("%.2x\b\b",cmd[0]&0x7f); wait(0.1); } } but when I export form web,open with keil ,but there are error at first line it is" error :in include chain (stdlib.h):declaration of "atexit" has a different language linkage."

Are you using the free MDK-ARM?

posted by Adam Osborn 11 Sep 2013

No.

posted by Albert zhang 11 Sep 2013

Hello Albert zhang,

what is your version of KEIL?

posted by Martin Kojtal 11 Sep 2013

Ok, well I used the free version and got the same error.

I tracked it down to the stdlib.h file, the declaration of 'atexit' is preceded by the line 'extern "C++"', which when commented out, removes the error, but I assume just shifts the problem to something else.

I think Keil doesn't like using C++ code in a C file or something along those lines.

posted by Adam Osborn 11 Sep 2013
Be the first to answer this question.