Keil-Fehler C129 beheben: "missing ';'" ohne fehlendes Semikolon (EFM8)

English Deutsch

Problem:

Sie haben Quellcode wie

example.c
uint16_t convert(uint16_t input) {
    return input * 2;
}

den Sie mit EFM8 kompilieren möchten

example.c
// *** ERROR C129 IN LINE 1 OF C:\Users\user\TestProject\src\Test.c: missing ';' before 'convert'

Lösung

Keil weiß nicht, was das uint16_t vor der Deklaration von convert() bedeutet.

example.c
#include <stdint.h>

stdint.h enthält Deklarationen für mehrere Standard-Ganzzahltypen wie uint8_t, uint16_t, uint32_t, int16_t usw.

Der finale Code sollte so aussehen:

example.c
#include <stdint.h>

uint16_t convert(uint16_t input) {
    return input * 2;
}

Check out similar posts by category: EFM8