How to fix "Multiple definition" in SDCC? | pressku.com

Trending 1 month ago

I made a task pinch 4 root files and 4 header files: main.h, main.c, timer.h, timer.c, display.h, display.c, exti.h, exti.c, when I compiled them with sdcc -c xxx, I sewage 4 .rel files: main.rel, timer.rel, display.rel, exti.rel, then I run sdcc main.rel timer.rel display.rel exti.rel, past it was prompted "Multiple meaning ...".

The mobility is, sdcc could only compile 1 root record 1 time, and I person variables and functions transverse reference in-between respective files, they could not beryllium separated successful azygous file, so, if I don't want each nan 8 files concentrated into 1 .c record and 1 .h file, what's nan way? I tried "extern" keyword, it didn't work.

More
close